mirror of
https://github.com/php/php-src.git
synced 2024-09-22 02:17:32 +00:00
(php_addslashes) Fixed stop condition - it should only take into account
the length of the string, not the characters.
This commit is contained in:
parent
4773b98ac6
commit
fbced1b9cc
@ -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++ = '\\';
|
||||
|
Loading…
Reference in New Issue
Block a user