summaryrefslogtreecommitdiff
path: root/json.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2009-09-10 09:05:32 +0000
committerEric S. Raymond <esr@thyrsus.com>2009-09-10 09:05:32 +0000
commitb85ca4e26b61471cd17e9468efbb49c56b77fdb9 (patch)
tree51fe0e01ae5665a98f4b28fda241ee244ca80e8e /json.c
parentdad8b2b68113840c826e43e3857c487498271c85 (diff)
downloadgpsd-b85ca4e26b61471cd17e9468efbb49c56b77fdb9.tar.gz
Son of the Splint Cleanup.
Major change in this set is enforcong consistency about the data type of serial parity information.
Diffstat (limited to 'json.c')
-rw-r--r--json.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/json.c b/json.c
index e819fa4b..245c77d1 100644
--- a/json.c
+++ b/json.c
@@ -196,7 +196,7 @@ static int json_internal_read_object(const char *cp,
}
state = await_value;
if (cursor->type == string)
- maxlen = cursor->len - 1;
+ maxlen = (int)cursor->len - 1;
else if (cursor->type == check)
maxlen = strlen(cursor->dflt.check);
else if (cursor->map != NULL)
@@ -327,7 +327,7 @@ static int json_internal_read_object(const char *cp,
(void)strncpy(lptr, valbuf, cursor->len);
break;
case boolean:
- *((bool *)lptr) = (bool)!strcmp(valbuf, "true");
+ *((bool *)lptr) = (strcmp(valbuf, "true") == 0);
break;
case character:
if (strlen(valbuf) > 1)