提交 d4906be4 编写于 作者: K Kevin Branigan

Merge pull request #23 from FSMaxB/format_fix

Fix format problem with empty objects
...@@ -563,7 +563,7 @@ static char *print_object(cJSON *item,int depth,int fmt,printbuffer *p) ...@@ -563,7 +563,7 @@ static char *print_object(cJSON *item,int depth,int fmt,printbuffer *p)
else out=(char*)cJSON_malloc(fmt?depth+4:3); else out=(char*)cJSON_malloc(fmt?depth+4:3);
if (!out) return 0; if (!out) return 0;
ptr=out;*ptr++='{'; ptr=out;*ptr++='{';
if (fmt) {*ptr++='\n';for (i=0;i<depth-1;i++) *ptr++='\t';} if (fmt) {*ptr++='\n';for (i=0;i<depth;i++) *ptr++='\t';}
*ptr++='}';*ptr++=0; *ptr++='}';*ptr++=0;
return out; return out;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册