aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--jim-json.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/jim-json.c b/jim-json.c
index 1b3869c..aeeb7cf 100644
--- a/jim-json.c
+++ b/jim-json.c
@@ -141,7 +141,10 @@ json_decode_dump_container(Jim_Interp *interp, struct json_state *state)
json_schema_t container_type = JSON_OBJ; /* JSON_LIST, JSON_MIXED or JSON_OBJ */
if (state->schemaObj) {
- json_schema_t list_type;
+ /* Don't strictly need to initialise this, but some compilers can't figure out it is always
+ * assigned a value below.
+ */
+ json_schema_t list_type = JSON_STR;
/* Figure out the type to use for the container */
if (type == JSMN_ARRAY) {
/* If every element of the array is of the same primitive schema type (str, bool or num),