summaryrefslogtreecommitdiff
path: root/gpsd_json.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2015-02-05 05:48:25 -0500
committerEric S. Raymond <esr@thyrsus.com>2015-02-05 22:37:15 -0500
commit2d8263172370f207311479dc77c6164348b011a5 (patch)
tree2c5051a34b6044e84fa0dd4015dcb81e42f4f049 /gpsd_json.c
parent92ec1f2ae42f3f72e60ad70fd4efba8a03eacb69 (diff)
downloadgpsd-2d8263172370f207311479dc77c6164348b011a5.tar.gz
Fix some untested cases in JSON AIS dumping.
Addresses Savannah bug #44183: Some bugs in json-encoding. All regression tests pass.
Diffstat (limited to 'gpsd_json.c')
-rw-r--r--gpsd_json.c6
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,