提交 18081c03 编写于 作者: M Max Bruckner

reformatting: cJSON_strdup

上级 542ed727
......@@ -70,8 +70,12 @@ static char* cJSON_strdup(const char* str)
char* copy;
len = strlen(str) + 1;
if (!(copy = (char*)cJSON_malloc(len))) return 0;
memcpy(copy,str,len);
if (!(copy = (char*)cJSON_malloc(len)))
{
return 0;
}
memcpy(copy, str, len);
return copy;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册