diff --git a/cJSON.c b/cJSON.c index 030311c..a8d7888 100644 --- a/cJSON.c +++ b/cJSON.c @@ -1317,6 +1317,8 @@ static cJSON_bool parse_value(cJSON * const item, parse_buffer * const input_buf if (can_read(input_buffer, 4) && (strncmp((const char*)buffer_at_offset(input_buffer), "null", 4) == 0)) { item->type = cJSON_NULL; + item->valueint = 0; + item->valuedouble = 0; input_buffer->offset += 4; return true; } @@ -1324,6 +1326,8 @@ static cJSON_bool parse_value(cJSON * const item, parse_buffer * const input_buf if (can_read(input_buffer, 5) && (strncmp((const char*)buffer_at_offset(input_buffer), "false", 5) == 0)) { item->type = cJSON_False; + item->valueint = 0; + item->valuedouble = 0; input_buffer->offset += 5; return true; } @@ -1332,6 +1336,7 @@ static cJSON_bool parse_value(cJSON * const item, parse_buffer * const input_buf { item->type = cJSON_True; item->valueint = 1; + item->valuedouble = 1; input_buffer->offset += 4; return true; }