mirror of
https://github.com/DaveGamble/cJSON.git
synced 2023-08-10 21:13:26 +03:00
Move increment out of loop condition fixes #85
This commit is contained in:
parent
a0431e226f
commit
fcc89c4bb2
3
cJSON.c
3
cJSON.c
@ -491,7 +491,7 @@ static const char *parse_string(cJSON *item, const char *str, const char **ep)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
while ((*end_ptr != '\"') && *end_ptr && ++len)
|
||||
while ((*end_ptr != '\"') && *end_ptr)
|
||||
{
|
||||
if (*end_ptr++ == '\\')
|
||||
{
|
||||
@ -503,6 +503,7 @@ static const char *parse_string(cJSON *item, const char *str, const char **ep)
|
||||
/* Skip escaped quotes. */
|
||||
end_ptr++;
|
||||
}
|
||||
len++;
|
||||
}
|
||||
|
||||
/* This is at most how long we need for the string, roughly. */
|
||||
|
Loading…
Reference in New Issue
Block a user