From 282006d918c3510af42dd2eb0011c0d01480a244 Mon Sep 17 00:00:00 2001 From: Max Bruckner Date: Tue, 27 Sep 2016 23:46:39 +0700 Subject: [PATCH] reformatting: update --- cJSON.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/cJSON.c b/cJSON.c index e6372a7..191dc33 100644 --- a/cJSON.c +++ b/cJSON.c @@ -256,12 +256,17 @@ static char* ensure(printbuffer *p, int needed) return newbuffer + p->offset; } +/* calculate the new length of the string in a printbuffer */ static int update(printbuffer *p) { - char *str; - if (!p || !p->buffer) return 0; - str=p->buffer+p->offset; - return p->offset+strlen(str); + char *str; + if (!p || !p->buffer) + { + return 0; + } + str = p->buffer + p->offset; + + return p->offset + strlen(str); } /* Render the number nicely from the given item into a string. */