From b735d05e0579c60c542f7c8fcab961ce4401c32f Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Thu, 10 Sep 2009 11:09:03 +0000 Subject: Splint Cleanup Meets Billy The Kid. All regression tests pass. --- ais_json.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'ais_json.c') 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; } -- cgit v1.2.1