summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Haszlakiewicz <erh+git@nimenees.com>2018-01-26 23:46:33 -0500
committerGitHub <noreply@github.com>2018-01-26 23:46:33 -0500
commitf8eb1dec64440d68149ce6ac70756af18a90bfb9 (patch)
treeeb8a092809810bc3f8a12c9f6c3376556182ba3d
parent250de31f17ff01b0a0d86a10640f91426618c385 (diff)
parentcdc4e9f64bfdabfb556960f0179638097b981157 (diff)
downloadjson-c-f8eb1dec64440d68149ce6ac70756af18a90bfb9.tar.gz
Merge pull request #399 from jonathan-wiens/bugfix/initialize_variable
Avoid uninitialized variable warnings
-rw-r--r--json_object.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/json_object.h b/json_object.h
index db63d22..a3a86c0 100644
--- a/json_object.h
+++ b/json_object.h
@@ -523,8 +523,8 @@ JSON_EXPORT void json_object_object_del(struct json_object* obj, const char *key
#else /* ANSI C or MSC */
# define json_object_object_foreach(obj,key,val) \
- char *key;\
- struct json_object *val; \
+ char *key = NULL;\
+ struct json_object *val = NULL; \
struct lh_entry *entry ## key; \
struct lh_entry *entry_next ## key = NULL; \
for(entry ## key = json_object_get_object(obj)->head; \