summaryrefslogtreecommitdiff
path: root/ais_json.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2009-09-10 11:09:03 +0000
committerEric S. Raymond <esr@thyrsus.com>2009-09-10 11:09:03 +0000
commitb735d05e0579c60c542f7c8fcab961ce4401c32f (patch)
tree2db7161ef4d35c66785f57158e030a2a6641eef5 /ais_json.c
parentb85ca4e26b61471cd17e9468efbb49c56b77fdb9 (diff)
downloadgpsd-b735d05e0579c60c542f7c8fcab961ce4401c32f.tar.gz
Splint Cleanup Meets Billy The Kid. All regression tests pass.
Diffstat (limited to 'ais_json.c')
-rw-r--r--ais_json.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/ais_json.c b/ais_json.c
index 79ead5aa..d2f9c552 100644
--- a/ais_json.c
+++ b/ais_json.c
@@ -33,10 +33,12 @@ static void lenhex_unpack(const char *from,
/*@ +mustdefine @*/
int json_ais_read(const char *buf,
- char *path, size_t pathlen,
- struct ais_t *ais,
- const char **endptr)
+ char *path, size_t pathlen,
+ struct ais_t *ais,
+ /*@null@*/const char **endptr)
{
+ /*@-compdef@*//* splint is confused by storage declared in the .i file */
+ /*@-nullstate@*/
#define AIS_HEADER \
{"class", check, .dflt.check = "AIS"}, \
@@ -130,9 +132,11 @@ int json_ais_read(const char *buf,
} else if (strstr(buf, "\"type\":24,") != NULL) {
status = json_read_object(buf, json_ais24, endptr);
} else {
- *endptr = NULL;
+ if (endptr != NULL)
+ *endptr = NULL;
return JSON_ERR_MISC;
}
+ /*@+compdef +nullstate@*/
return status;
}