diff options
author | Matt <ukyg9e5r6k7gubiekd6@yahoo.com> | 2015-01-08 03:47:34 -0500 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2015-01-08 03:47:34 -0500 |
commit | 881f408458d56e6876495d84a005b87877513e4d (patch) | |
tree | c50ec07a317608977ce7cdf2b641355c12e7f6f1 /libgps_json.c | |
parent | d92bb6df74ead98ab96a01e175df00e039ccc40e (diff) | |
download | gpsd-881f408458d56e6876495d84a005b87877513e4d.tar.gz |
The STARTSWITH macro in libgps_json.c uses sizeof when it means strlen.
Diffstat (limited to 'libgps_json.c')
-rw-r--r-- | libgps_json.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libgps_json.c b/libgps_json.c index ff060f67..e30c6e99 100644 --- a/libgps_json.c +++ b/libgps_json.c @@ -395,7 +395,7 @@ int libgps_json_unpack(const char *buf, if (classtag == NULL) return -1; -#define STARTSWITH(str, prefix) strncmp(str, prefix, sizeof(prefix)-1)==0 +#define STARTSWITH(str, prefix) strncmp(str, prefix, strlen(prefix)-1)==0 if (STARTSWITH(classtag, "\"class\":\"TPV\"")) { status = json_tpv_read(buf, gpsdata, end); gpsdata->status = STATUS_FIX; |