mirror of
https://github.com/DaveGamble/cJSON.git
synced 2023-08-10 21:13:26 +03:00
Merge 860ed3a77c24697c3a7d796f1e9c10cedccda217 into cb8693b058ba302f4829ec6d03f609ac6f848546
This commit is contained in:
commit
5ffec39d1a
9
cJSON.c
9
cJSON.c
@ -405,10 +405,13 @@ CJSON_PUBLIC(char*) cJSON_SetValuestring(cJSON *object, const char *valuestring)
|
|||||||
{
|
{
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
if (strlen(valuestring) <= strlen(object->valuestring))
|
if (object->valuestring != NULL)
|
||||||
{
|
{
|
||||||
strcpy(object->valuestring, valuestring);
|
if (strlen(valuestring) <= strlen(object->valuestring))
|
||||||
return object->valuestring;
|
{
|
||||||
|
strcpy(object->valuestring, valuestring);
|
||||||
|
return object->valuestring;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
copy = (char*) cJSON_strdup((const unsigned char*)valuestring, &global_hooks);
|
copy = (char*) cJSON_strdup((const unsigned char*)valuestring, &global_hooks);
|
||||||
if (copy == NULL)
|
if (copy == NULL)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user