diff options
author | Andrei Zmievski <andrei@php.net> | 2000-07-21 15:29:59 +0000 |
---|---|---|
committer | Andrei Zmievski <andrei@php.net> | 2000-07-21 15:29:59 +0000 |
commit | fbced1b9cc50b839a0214352ee77391c533ac08f (patch) | |
tree | ade12459cac1116f739a42b2b11392f8722bdde8 | |
parent | 4773b98ac634ca280b64b56f43fedd44e47f3b90 (diff) | |
download | php-git-fbced1b9cc50b839a0214352ee77391c533ac08f.tar.gz |
(php_addslashes) Fixed stop condition - it should only take into account
the length of the string, not the characters.
-rw-r--r-- | ext/standard/string.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/ext/standard/string.c b/ext/standard/string.c index dd761f1da0..c8217b8ace 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -1706,7 +1706,8 @@ PHPAPI char *php_addslashes(char *str, int length, int *new_length, int should_f return str; } new_str = (char *) emalloc((length?length:(length=strlen(str)))*2+1); - for (source=str,end=source+length,target=new_str; (c = *source) || source<end; source++) { + for (source=str,end=source+length,target=new_str; source<end; source++) { + c = *source; switch(c) { case '\0': *target++ = '\\'; |