diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2015-02-05 05:48:25 -0500 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2015-02-05 22:37:15 -0500 |
commit | 2d8263172370f207311479dc77c6164348b011a5 (patch) | |
tree | 2c5051a34b6044e84fa0dd4015dcb81e42f4f049 | |
parent | 92ec1f2ae42f3f72e60ad70fd4efba8a03eacb69 (diff) | |
download | gpsd-2d8263172370f207311479dc77c6164348b011a5.tar.gz |
Fix some untested cases in JSON AIS dumping.
Addresses Savannah bug #44183: Some bugs in json-encoding.
All regression tests pass.
-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 91031a30..7bb56aff 100644 --- a/gpsd_json.c +++ b/gpsd_json.c @@ -2701,7 +2701,7 @@ void json_aivdm_dump(const struct ais_t *ais, "\"speed_q\":%s," "\"course_q\":%s," "\"heading_q\":%s}\r\n", - ais->type8.dac200fid10.vin, + json_stringify(buf1, sizeof(buf1), ais->type8.dac200fid10.vin), ais->type8.dac200fid10.length, ais->type8.dac200fid10.beam, ais->type8.dac200fid10.shiptype, @@ -2763,7 +2763,7 @@ void json_aivdm_dump(const struct ais_t *ais, ais->type8.dac200fid24.country); for (i = 0; i < ais->type8.dac200fid24.ngauges; i++) { str_appendf(buf, buflen, - "{\"id\":%u,\"level\":%d}", + "{\"id\":%u,\"level\":%d},", ais->type8.dac200fid24.gauges[i].id, ais->type8.dac200fid24.gauges[i].level); } @@ -3213,7 +3213,7 @@ void json_aivdm_dump(const struct ais_t *ais, ais->type24.callsign)); if (AIS_AUXILIARY_MMSI(ais->mmsi)) { str_appendf(buf, buflen, - "\"mothership_mmsi\":%u}\r\n", + "\"mothership_mmsi\":%u", ais->type24.mothership_mmsi); } else { str_appendf(buf, buflen, |