diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2012-05-21 01:55:35 -0400 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2012-05-21 01:57:10 -0400 |
commit | 9b96ab4b979cfda8f3a306ff887bd0adb8da3cc9 (patch) | |
tree | 78a4874e9500d22641baebe2d763ca2c78f35567 /gpsd_json.c | |
parent | 247a263f13b7a70423dddfaadbc3db679f429afe (diff) | |
download | gpsd-9b96ab4b979cfda8f3a306ff887bd0adb8da3cc9.tar.gz |
Fix a few remnant strlcat calls that still weren't right.
All regression tests pass.
Diffstat (limited to 'gpsd_json.c')
-rw-r--r-- | gpsd_json.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/gpsd_json.c b/gpsd_json.c index 6b05c6cd..7e8c89e3 100644 --- a/gpsd_json.c +++ b/gpsd_json.c @@ -434,7 +434,7 @@ void json_watch_dump(const struct policy_t *ccp, "\"device\":\"%s\",", ccp->devpath); if (reply[strlen(reply) - 1] == ',') reply[strlen(reply) - 1] = '\0'; - (void)strlcat(reply, "}\r\n", replylen - strlen(reply)); + (void)strlcat(reply, "}\r\n", replylen); /*@+compdef@*/ } @@ -1066,11 +1066,11 @@ void json_rtcm3_dump(const struct rtcm3_t *rtcm, "\"station_id\":%u,\"system\":[", rtcm->rtcmtypes.rtcm3_1005.station_id); if ((rtcm->rtcmtypes.rtcm3_1005.system & 0x04)!=0) - (void)strlcat(buf, "\"GPS\",", buflen - strlen(buf)); + (void)strlcat(buf, "\"GPS\",", buflen); if ((rtcm->rtcmtypes.rtcm3_1005.system & 0x02)!=0) (void)strlcat(buf, "\"GLONASS\",", buflen - strlen(buf)); if ((rtcm->rtcmtypes.rtcm3_1005.system & 0x01)!=0) - (void)strlcat(buf, "\"GALILEO\",", buflen - strlen(buf)); + (void)strlcat(buf, "\"GALILEO\",", buflen); if (buf[strlen(buf)-1] == ',') buf[strlen(buf)-1] = '\0'; (void)snprintf(buf + strlen(buf), buflen - strlen(buf), |