diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2018-08-09 10:50:45 -0400 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2018-08-09 11:06:54 -0400 |
commit | 2ed105d6ff670b74ee43afff97cd4a9cf5eeeae1 (patch) | |
tree | 5f694ca20e1a522dabd07c17c80c53ba88596fae /json.c | |
parent | 1a95834c2abb8aff5bead72f5a19a3da02be176a (diff) | |
download | gpsd-2ed105d6ff670b74ee43afff97cd4a9cf5eeeae1.tar.gz |
Reconverge with microjson version..
Diffstat (limited to 'json.c')
-rw-r--r-- | json.c | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -168,12 +168,12 @@ static int json_internal_read_object(const char *cp, { enum { init, await_attr, in_attr, await_value, in_val_string, - in_escape, in_val_token, post_val, post_array + in_escape, in_val_token, post_val, post_element } state = 0; #ifdef CLIENTDEBUG_ENABLE char *statenames[] = { "init", "await_attr", "in_attr", "await_value", "in_val_string", - "in_escape", "in_val_token", "post_val", "post_array", + "in_escape", "in_val_token", "post_val", "post_element", }; #endif /* CLIENTDEBUG_ENABLE */ char attrbuf[JSON_ATTR_MAX + 1], *pattr = NULL; @@ -324,7 +324,7 @@ static int json_internal_read_object(const char *cp, substatus = json_read_array(cp, &cursor->addr.array, &cp); if (substatus != 0) return substatus; - state = post_array; + state = post_element; } else if (cursor->type == t_array) { json_debug_trace((1, "Array element was specified, but no [.\n")); @@ -554,7 +554,7 @@ static int json_internal_read_object(const char *cp, break; } __attribute__ ((fallthrough)); - case post_array: + case post_element: if (isspace((unsigned char) *cp)) continue; else if (*cp == ',') @@ -782,6 +782,7 @@ const char *json_error_string(int err) "didn't see quoted value when expecting string", "other data conversion error", "unexpected null value or attribute pointer", + "object element specified, but no {", }; if (err <= 0 || err >= (int)(sizeof(errors) / sizeof(errors[0]))) |