cJSON

mirror of Dave's cJSON
git clone git://git.thc420.xyz/cJSON
Log | Files | Refs | README | LICENSE

commit d4906be4f004e57e10c913046e517264dadfb245
parent 361b9a58cbcc4b293424e875aa7714cf079989d0
Author: Kevin Branigan <kbranigan@gmail.com>
Date:   Sun, 25 Oct 2015 22:02:33 -0400

Merge pull request #23 from FSMaxB/format_fix

Fix format problem with empty objects

Diffstat:
McJSON.c | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cJSON.c b/cJSON.c @@ -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); if (!out) return 0; 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; return out; }