diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2012-05-17 03:07:46 -0400 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2012-05-17 03:07:46 -0400 |
commit | b78d86b400d6e7070cbeb0efd39194248232257c (patch) | |
tree | 1b2f6324027bcc630da6df559d571c431b9813fe /pseudonmea.c | |
parent | 0b0b6109b742b49b747202c4d1dd969eaba77915 (diff) | |
download | gpsd-b78d86b400d6e7070cbeb0efd39194248232257c.tar.gz |
Clean up from cppcheck warnings. All regression tests pass.
Diffstat (limited to 'pseudonmea.c')
-rw-r--r-- | pseudonmea.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/pseudonmea.c b/pseudonmea.c index f84dc010..0847df88 100644 --- a/pseudonmea.c +++ b/pseudonmea.c @@ -163,11 +163,12 @@ static void gpsd_binary_satellite_dump(struct gps_device_t *session, static void gpsd_binary_quality_dump(struct gps_device_t *session, char bufp[], size_t len) { - int i, j; char *bufp2 = bufp; bool used_valid = (session->gpsdata.set & USED_IS) != 0; if (session->device_type != NULL && (session->gpsdata.set & MODE_SET) != 0) { + int i, j; + (void)snprintf(bufp, len - strlen(bufp), "$GPGSA,%c,%d,", 'A', session->gpsdata.fix.mode); j = 0; @@ -224,11 +225,11 @@ static void gpsd_binary_time_dump(struct gps_device_t *session, char bufp[], size_t len) { struct tm tm; - double integral, fractional; + double integral; time_t integral_time; if (session->newdata.mode > MODE_NO_FIX) { - fractional = modf(session->newdata.time, &integral); + double fractional = modf(session->newdata.time, &integral); integral_time = (time_t) integral; (void)gmtime_r(&integral_time, &tm); /* |