diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2013-11-05 20:21:42 -0500 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2013-11-05 20:21:42 -0500 |
commit | 032607920d8d6f335e3bfbca1fc76e9d77dc7457 (patch) | |
tree | 632e28102497e16d43be91ca0dbcec5a7ed5041c /gpsd_json.c | |
parent | 6a0157a94666ae5a653bc297aedc1f6c8f1eaf3a (diff) | |
download | gpsd-032607920d8d6f335e3bfbca1fc76e9d77dc7457.tar.gz |
Full splint cleanup. Partial cppcheck cleanup.
Diffstat (limited to 'gpsd_json.c')
-rw-r--r-- | gpsd_json.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/gpsd_json.c b/gpsd_json.c index dbebcc5c..0a5fc22c 100644 --- a/gpsd_json.c +++ b/gpsd_json.c @@ -275,7 +275,7 @@ void json_noise_dump(const struct gps_data_t *gpsdata, void json_sky_dump(const struct gps_data_t *datap, /*@out@*/ char *reply, size_t replylen) { - int i, j, used, reported = 0; + int i, reported = 0; char tbuf[JSON_DATE_MAX+1]; assert(replylen > 2); @@ -328,10 +328,11 @@ void json_sky_dump(const struct gps_data_t *datap, if (reported) { (void)strlcat(reply, "\"satellites\":[", replylen); for (i = 0; i < reported; i++) { - used = 0; + int j; + bool used = false; for (j = 0; j < datap->satellites_used; j++) if (datap->used[j] == datap->PRN[i]) { - used = 1; + used = true; break; } if (datap->PRN[i]) { |