From 2b4d17b3376488f17d3e9ba9822d85a2fd55f8a1 Mon Sep 17 00:00:00 2001 From: Krzysztof Gabis Date: Sat, 25 Apr 2015 18:31:35 +0100 Subject: [PATCH] Replaced strlen in process_string with pointer arithmetic. --- parson.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parson.c b/parson.c index fd1b51c..83a21ff 100644 --- a/parson.c +++ b/parson.c @@ -437,7 +437,7 @@ static char* process_string(const char *input, size_t len) { input_ptr++; } *output_ptr = '\0'; - if (try_realloc((void**)&output, strlen(output) + 1) == JSONFailure) + if (try_realloc((void**)&output, (size_t)(output_ptr-output) + 1) == JSONFailure) /* resize to new length */ goto error; return output; error: