From 881f408458d56e6876495d84a005b87877513e4d Mon Sep 17 00:00:00 2001 From: Matt Date: Thu, 8 Jan 2015 03:47:34 -0500 Subject: The STARTSWITH macro in libgps_json.c uses sizeof when it means strlen. --- libgps_json.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- cgit v1.2.1