Sfoglia il codice sorgente

reformatting: update

Max Bruckner 8 anni fa
parent
commit
282006d918
1 ha cambiato i file con 9 aggiunte e 4 eliminazioni
  1. 9 4
      cJSON.c

+ 9 - 4
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. */