Explorar o código

cJSON_strdup: Use sizeof("") instead of 1

Max Bruckner %!s(int64=8) %!d(string=hai) anos
pai
achega
c784f76c77
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      cJSON.c

+ 1 - 1
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;