cJSON_strdup: Use sizeof("") instead of 1

This commit is contained in:
Max Bruckner
2017-04-08 01:29:19 +02:00
parent 84237ff48e
commit c784f76c77
+1 -1
View File
@@ -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;