From 10b888be54f57cd46a88b21eb8c50ca13dd8c043 Mon Sep 17 00:00:00 2001 From: DongwenHuang Date: Mon, 15 Jun 2015 17:13:22 +0800 Subject: [PATCH] Update cJSON.c --- cJSON.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cJSON.c b/cJSON.c index fe446d6..b1f3cc1 100644 --- a/cJSON.c +++ b/cJSON.c @@ -467,7 +467,7 @@ static char *print_object(cJSON *item,int depth,int fmt) /* Collect all the results into our arrays: */ child=item->child;depth++;if (fmt) len+=depth; - while (child) + while (child&&!fail) { names[i]=str=print_string_ptr(child->string); entries[i++]=ret=print_value(child,depth,fmt);