Skip to content

Commit

Permalink
cJSON_strdup: Use sizeof("") instead of 1
Browse files Browse the repository at this point in the history
  • Loading branch information
FSMaxB committed Apr 7, 2017
1 parent 84237ff commit c784f76
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cJSON.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit c784f76

Please sign in to comment.