cJSON

mirror of Dave's cJSON
git clone git://git.thc420.xyz/cJSON
Log | Files | Refs | README | LICENSE

commit fcc89c4bb264d665929b00eeebc479a643a90896
parent a0431e226f355204db914da021098bbf9d9e3615
Author: Max Bruckner <max@maxbruckner.de>
Date:   Thu, 15 Dec 2016 11:12:07 +0100

Move increment out of loop condition fixes #85

Diffstat:
McJSON.c | 3++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/cJSON.c b/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. */