commit c784f76c77a225b814817250009a87980b9f9e59 parent 84237ff48e69825c94261c624eb0376d0c328139 Author: Max Bruckner <max@maxbruckner.de> Date: Mon, 6 Mar 2017 10:48:15 +0100 cJSON_strdup: Use sizeof("") instead of 1 Diffstat:
M | cJSON.c | | | 2 | +- |
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/cJSON.c b/cJSON.c @@ -100,7 +100,7 @@ static unsigned char* cJSON_strdup(const unsigned char* str, const internal_hook return NULL; } - len = strlen((const char*)str) + 1; + len = strlen((const char*)str) + sizeof(""); if (!(copy = (unsigned char*)hooks->allocate(len))) { return NULL;