summaryrefslogtreecommitdiff
path: root/gpsd_json.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2012-05-09 18:05:08 -0400
committerEric S. Raymond <esr@thyrsus.com>2012-05-09 18:05:08 -0400
commit96564c6ea94dbf43c6a2c4ea9d005a0f195311d2 (patch)
treec0d4e05798f402c032035dac54f0bb178a0b4a84 /gpsd_json.c
parent0f43a36464a8b5ddcef9f7861701db4abbd777f2 (diff)
downloadgpsd-96564c6ea94dbf43c6a2c4ea9d005a0f195311d2.tar.gz
Coverity scanning found two bad-sizeof defects.
Diffstat (limited to 'gpsd_json.c')
-rw-r--r--gpsd_json.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gpsd_json.c b/gpsd_json.c
index 0c5e39c1..08ba8f42 100644
--- a/gpsd_json.c
+++ b/gpsd_json.c
@@ -227,7 +227,7 @@ void json_tpv_dump(const struct gps_device_t *session,
}
if (reply[strlen(reply) - 1] == ',')
reply[strlen(reply) - 1] = '\0'; /* trim trailing comma */
- (void)strlcat(reply, "}\r\n", sizeof(reply) - strlen(reply));
+ (void)strlcat(reply, "}\r\n", replylen - strlen(reply));
}
void json_noise_dump(const struct gps_data_t *gpsdata,
@@ -268,7 +268,7 @@ void json_noise_dump(const struct gps_data_t *gpsdata,
if (reply[strlen(reply) - 1] == ',')
reply[strlen(reply) - 1] = '\0'; /* trim trailing comma */
- (void)strlcat(reply, "}\r\n", sizeof(reply) - strlen(reply));
+ (void)strlcat(reply, "}\r\n", replylen - strlen(reply));
}
void json_sky_dump(const struct gps_data_t *datap,