reformatting: update

This commit is contained in:
Max Bruckner 2016-09-27 23:46:39 +07:00
parent 7f9a2691bf
commit 282006d918

13
cJSON.c
View File

@ -256,12 +256,17 @@ static char* ensure(printbuffer *p, int needed)
return newbuffer + p->offset; return newbuffer + p->offset;
} }
/* calculate the new length of the string in a printbuffer */
static int update(printbuffer *p) static int update(printbuffer *p)
{ {
char *str; char *str;
if (!p || !p->buffer) return 0; if (!p || !p->buffer)
str=p->buffer+p->offset; {
return p->offset+strlen(str); return 0;
}
str = p->buffer + p->offset;
return p->offset + strlen(str);
} }
/* Render the number nicely from the given item into a string. */ /* Render the number nicely from the given item into a string. */