summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/standard/string.c3
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++ = '\\';