mirror of https://github.com/DaveGamble/cJSON
Merge 071f8ab633
into 66e9dff670
This commit is contained in:
commit
1e43d3d87f
2
cJSON.c
2
cJSON.c
|
@ -410,7 +410,7 @@ CJSON_PUBLIC(char*) cJSON_SetValuestring(cJSON *object, const char *valuestring)
|
|||
{
|
||||
return NULL;
|
||||
}
|
||||
if (strlen(valuestring) <= strlen(object->valuestring))
|
||||
if (object->valuestring && (strlen(valuestring) <= strlen(object->valuestring)))
|
||||
{
|
||||
strcpy(object->valuestring, valuestring);
|
||||
return object->valuestring;
|
||||
|
|
Loading…
Reference in New Issue