提交 6a7fe541 authored 作者: Anthony Minessale's avatar Anthony Minessale

FS-4285 --resolve

上级 992e0566
...@@ -50,10 +50,11 @@ static char* cJSON_strdup(const char* str) ...@@ -50,10 +50,11 @@ static char* cJSON_strdup(const char* str)
{ {
size_t len; size_t len;
char* copy; char* copy;
const char *s = str ? str : "";
len = strlen(str) + 1; len = strlen(s) + 1;
if (!(copy = (char*)cJSON_malloc(len))) return 0; if (!(copy = (char*)cJSON_malloc(len))) return 0;
memcpy(copy,str,len); memcpy(copy,s,len);
return copy; return copy;
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论