diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2009-09-10 11:09:03 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2009-09-10 11:09:03 +0000 |
commit | b735d05e0579c60c542f7c8fcab961ce4401c32f (patch) | |
tree | 2db7161ef4d35c66785f57158e030a2a6641eef5 /ais_json.c | |
parent | b85ca4e26b61471cd17e9468efbb49c56b77fdb9 (diff) | |
download | gpsd-b735d05e0579c60c542f7c8fcab961ce4401c32f.tar.gz |
Splint Cleanup Meets Billy The Kid. All regression tests pass.
Diffstat (limited to 'ais_json.c')
-rw-r--r-- | ais_json.c | 12 |
1 files changed, 8 insertions, 4 deletions
@@ -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; } |