From fda771a82061055da394620cdd6c518524d437b0 Mon Sep 17 00:00:00 2001 From: liquanqing Date: Sun, 5 May 2019 14:20:52 +0800 Subject: [PATCH] fix warning in cJSON.c --- easyflash/plugins/types/struct2json/src/cJSON.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/easyflash/plugins/types/struct2json/src/cJSON.c b/easyflash/plugins/types/struct2json/src/cJSON.c index 4e3e480..a2072b6 100644 --- a/easyflash/plugins/types/struct2json/src/cJSON.c +++ b/easyflash/plugins/types/struct2json/src/cJSON.c @@ -276,8 +276,8 @@ static char *print_string_ptr(const char *str,printbuffer *p) strcpy(out,"\"\""); return out; } - ptr=str;while ((token=*ptr) && ++len) {if (strchr("\"\\\b\f\n\r\t",token)) len++; else if (token<32) len+=5;ptr++;} - + + ptr=str;while (('\0' != (token=*ptr)) && ++len) {if (NULL != strchr("\"\\\b\f\n\r\t",token)) len++; else if (token<32) len+=5;ptr++;} if (p) out=ensure(p,len+3); else out=(char*)cJSON_malloc(len+3); if (!out) return 0;