summaryrefslogtreecommitdiff
path: root/gpspipe.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2009-12-01 23:40:12 +0000
committerEric S. Raymond <esr@thyrsus.com>2009-12-01 23:40:12 +0000
commit8682babcce49715b1ffc629b55da61e3e1789b0a (patch)
tree15c67c8259a92553987b73d9bf15d3c239251f1f /gpspipe.c
parentb825233926b52de5880ca5f459979c81182f9151 (diff)
downloadgpsd-8682babcce49715b1ffc629b55da61e3e1789b0a.tar.gz
Emitting well-formed JSON would sure help.
Diffstat (limited to 'gpspipe.c')
-rw-r--r--gpspipe.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/gpspipe.c b/gpspipe.c
index 9eb08064..d07b5db4 100644
--- a/gpspipe.c
+++ b/gpspipe.c
@@ -227,19 +227,19 @@ int main( int argc, char **argv)
*/
(void)strlcpy(buf, "?WATCH={", sizeof(buf));
if (watch)
- (void)strlcat(buf, "\"enable\"=true,", sizeof(buf));
+ (void)strlcat(buf, "\"enable\":true,", sizeof(buf));
else
- (void)strlcat(buf, "\"enable\"=false,", sizeof(buf));
+ (void)strlcat(buf, "\"enable\":false,", sizeof(buf));
if (raw)
/*
* Yes, -r invokes NMEA mode rather than proper raw mode.
* This emulates the behavior under the old protocol.
*/
- (void)strlcat(buf, "\"nmea\"=true,", sizeof(buf));
+ (void)strlcat(buf, "\"nmea\":true,", sizeof(buf));
if (binary)
- (void)strlcat(buf, "\"raw\"=2,", sizeof(buf));
+ (void)strlcat(buf, "\"raw\":2,", sizeof(buf));
if (source.device != NULL)
- (void)snprintf(buf, sizeof(buf), "\"path\"=\"%s\",", source.device);
+ (void)snprintf(buf, sizeof(buf), "\"path\":\"%s\",", source.device);
if (buf[strlen(buf)-1] == ',')
buf[strlen(buf)-1] = '\0';
(void)strlcat(buf, "}\r\n", sizeof(buf));