Kyle Chisholm 8 роки тому
батько
коміт
8df4cd46eb
1 змінених файлів з 1 додано та 3 видалено
  1. 1 3
      cJSON.c

+ 1 - 3
cJSON.c

@@ -894,14 +894,12 @@ char *cJSON_PrintBuffered(const cJSON *item, int prebuffer, cjbool fmt)
 
 int cJSON_PrintPreallocated(cJSON *item,char *buf, const int len, const cjbool fmt)
 {
-    char *out;
     printbuffer p;
     p.buffer = buf;
     p.length = len;
     p.offset = 0;
     p.noalloc = true;
-    out = print_value(item,0,fmt,&p);
-    return (out != buf ? -1 : 0);
+    return print_value(item,0,fmt,&p) != NULL;
 }
 
 /* Parser core - when encountering text, process appropriately. */