Skip to content

Commit

Permalink
print: \t --> space
Browse files Browse the repository at this point in the history
  • Loading branch information
nayuta-ueno committed Dec 22, 2018
1 parent 905f55a commit 38d1546
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/cJSON.c
Original file line number Diff line number Diff line change
Expand Up @@ -560,17 +560,17 @@ static char *print_object(cJSON *item,int depth,int fmt)
*out='{';ptr=out+1;if (fmt)*ptr++='\n';*ptr=0;
for (i=0;i<numentries;i++)
{
if (fmt) for (j=0;j<depth;j++) *ptr++='\t';
if (fmt) for (j=0;j<depth;j++) *ptr++=' ';
strcpy(ptr,names[i]);ptr+=strlen(names[i]);
*ptr++=':';if (fmt) *ptr++='\t';
*ptr++=':';if (fmt) *ptr++=' ';
strcpy(ptr,entries[i]);ptr+=strlen(entries[i]);
if (i!=numentries-1) *ptr++=',';
if (fmt) *ptr++='\n';*ptr=0;
cJSON_free(names[i]);cJSON_free(entries[i]);
}

cJSON_free(names);cJSON_free(entries);
if (fmt) for (i=0;i<depth-1;i++) *ptr++='\t';
if (fmt) for (i=0;i<depth-1;i++) *ptr++=' ';
*ptr++='}';*ptr++=0;
return out;
}
Expand Down

0 comments on commit 38d1546

Please sign in to comment.