summaryrefslogtreecommitdiff
path: root/ais_json.c
diff options
context:
space:
mode:
authorukyg9e5r6k7gubiekd6 <ukyg9e5r6k7gubiekd6@mailinator.com>2012-08-03 09:53:28 +1000
committerEric S. Raymond <esr@thyrsus.com>2012-09-07 05:13:25 -0400
commit6386d5265bb1df4d3b94d6f49f584da31f9714a1 (patch)
treeefdd78e9112c1f09c26ea1e930ce18930b877eb0 /ais_json.c
parentd7edd5c56e7f2a3af2b92778a8dfbd315f456099 (diff)
downloadgpsd-6386d5265bb1df4d3b94d6f49f584da31f9714a1.tar.gz
Silence cppcheck warning. Limits year values to 10^9 - 1.
Signed-off-by: Eric S. Raymond <esr@thyrsus.com>
Diffstat (limited to 'ais_json.c')
-rw-r--r--ais_json.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ais_json.c b/ais_json.c
index 75130280..55bf795b 100644
--- a/ais_json.c
+++ b/ais_json.c
@@ -97,9 +97,9 @@ int json_ais_read(const char *buf,
ais->type4.hour = AIS_HOUR_NOT_AVAILABLE;
ais->type4.minute = AIS_MINUTE_NOT_AVAILABLE;
ais->type4.second = AIS_SECOND_NOT_AVAILABLE;
- // We use %u for the date to allow for dodgy years (>9999) to go through
+ // We use %09u for the date to allow for dodgy years (>9999) to go through
// cppcheck-suppress uninitvar
- (void)sscanf(timestamp, "%u-%02u-%02uT%02u:%02u:%02uZ",
+ (void)sscanf(timestamp, "%09u-%02u-%02uT%02u:%02u:%02uZ",
&ais->type4.year,
&ais->type4.month,
&ais->type4.day,