mirror of
https://github.com/DaveGamble/cJSON.git
synced 2023-08-10 21:13:26 +03:00
reformatting: cJSON_strdup
This commit is contained in:
parent
542ed727d7
commit
18081c03c4
6
cJSON.c
6
cJSON.c
@ -70,8 +70,12 @@ static char* cJSON_strdup(const char* str)
|
|||||||
char* copy;
|
char* copy;
|
||||||
|
|
||||||
len = strlen(str) + 1;
|
len = strlen(str) + 1;
|
||||||
if (!(copy = (char*)cJSON_malloc(len))) return 0;
|
if (!(copy = (char*)cJSON_malloc(len)))
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
memcpy(copy, str, len);
|
memcpy(copy, str, len);
|
||||||
|
|
||||||
return copy;
|
return copy;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user