mirror of
https://github.com/DaveGamble/cJSON.git
synced 2023-08-10 21:13:26 +03:00
more concise return
This commit is contained in:
parent
3917fb5255
commit
8df4cd46eb
4
cJSON.c
4
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)
|
int cJSON_PrintPreallocated(cJSON *item,char *buf, const int len, const cjbool fmt)
|
||||||
{
|
{
|
||||||
char *out;
|
|
||||||
printbuffer p;
|
printbuffer p;
|
||||||
p.buffer = buf;
|
p.buffer = buf;
|
||||||
p.length = len;
|
p.length = len;
|
||||||
p.offset = 0;
|
p.offset = 0;
|
||||||
p.noalloc = true;
|
p.noalloc = true;
|
||||||
out = print_value(item,0,fmt,&p);
|
return print_value(item,0,fmt,&p) != NULL;
|
||||||
return (out != buf ? -1 : 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Parser core - when encountering text, process appropriately. */
|
/* Parser core - when encountering text, process appropriately. */
|
||||||
|
Loading…
Reference in New Issue
Block a user