summaryrefslogtreecommitdiff
path: root/gpsd_json.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2010-03-14 09:06:09 -0400
committerEric S. Raymond <esr@thyrsus.com>2010-03-14 09:06:09 -0400
commitde4764956479dce7151ec5b1460d80f5c1a853e4 (patch)
tree202feb0ee57d1e5a193f6e4012d5b9293abbc5d8 /gpsd_json.c
parentdff47ce0f43fa357dd2b12e7bee1d493ebe2b1a4 (diff)
downloadgpsd-de4764956479dce7151ec5b1460d80f5c1a853e4.tar.gz
Address Debian bug #573752 (mode sometimes missing from JSON.
Also, include some additions of copyrights on the test logs that somehow wint missing from the last commit (probably git operator error).
Diffstat (limited to 'gpsd_json.c')
-rw-r--r--gpsd_json.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/gpsd_json.c b/gpsd_json.c
index d8f9d5ba..6cc69620 100644
--- a/gpsd_json.c
+++ b/gpsd_json.c
@@ -175,10 +175,9 @@ void json_tpv_dump(const struct gps_data_t *gpsdata, struct gps_fix_t *fixp,
(void)snprintf(reply+strlen(reply),
replylen-strlen(reply),
"\"epc\":%.2f,", fixp->epc);
- if (fixp->mode > 0)
- (void)snprintf(reply+strlen(reply),
- replylen-strlen(reply),
- "\"mode\":%d,", fixp->mode);
+ (void)snprintf(reply+strlen(reply),
+ replylen-strlen(reply),
+ "\"mode\":%d,", fixp->mode);
if (reply[strlen(reply)-1] == ',')
reply[strlen(reply)-1] = '\0'; /* trim trailing comma */
(void)strlcat(reply, "}\r\n", sizeof(reply)-strlen(reply));