diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2011-01-25 14:53:41 -0500 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2011-01-25 14:53:41 -0500 |
commit | 388a3f00983a8135b9b5c09ecdc55411898318c1 (patch) | |
tree | 591b633d31ac4ca06657e6cda3e9ddd9a98e3449 | |
parent | 5f4a2717737a4c8c5a94ca70f47893db83a7cc30 (diff) | |
download | gpsd-388a3f00983a8135b9b5c09ecdc55411898318c1.tar.gz |
Fix typos pointed out in Berlios tracker bug #17858.
All regression tests pass.
-rw-r--r-- | gpsd.c | 15 | ||||
-rw-r--r-- | gpsd_json.c | 2 | ||||
-rw-r--r-- | libgps_core.c | 2 |
3 files changed, 10 insertions, 9 deletions
@@ -988,7 +988,7 @@ static void handle_request(struct subscriber_t *sub, (void)snprintf(reply, replylen, "{\"class\":\"ERROR\",\"message\":\"Invalid WATCH: %s\"}\r\n", json_error_string(status)); - gpsd_report(LOG_ERROR, "ERROR response: %s\n", reply); + gpsd_report(LOG_ERROR, "response: %s\n", reply); } else if (sub->policy.watcher) { if (sub->policy.devpath[0] == '\0') { /* awaken all devices */ @@ -999,16 +999,17 @@ static void handle_request(struct subscriber_t *sub, devp = find_device(sub->policy.devpath); if (devp == NULL) { (void)snprintf(reply, replylen, - "{\"class\":\"ERROR\",\"message\":\"Do nuch device as %s\"}\r\n", + "{\"class\":\"ERROR\",\"message\":\"No such device as %s\"}\r\n", sub->policy.devpath); - gpsd_report(LOG_ERROR, "ERROR response: %s\n", reply); + gpsd_report(LOG_ERROR, "response: %s\n", reply); goto bailout; - } else if (!awaken(devp)) + } else if (!awaken(devp)) { (void)snprintf(reply, replylen, "{\"class\":\"ERROR\",\"message\":\"Can't assign %s\"}\r\n", sub->policy.devpath); - gpsd_report(LOG_ERROR, "ERROR response: %s\n", reply); - goto bailout; + gpsd_report(LOG_ERROR, "response: %s\n", reply); + goto bailout; + } } } } @@ -1039,7 +1040,7 @@ static void handle_request(struct subscriber_t *sub, /*@-branchstate@*/ if (status != 0) { (void)snprintf(reply, replylen, - "{\"class\":\"ERROR\",\"message\":\"Invalid DEVICE: %s\"}\r\n", + "{\"class\":\"ERROR\",\"message\":\"Invalid DEVICE: \"%s\"}\r\n", json_error_string(status)); gpsd_report(LOG_ERROR, "ERROR response: %s\n", reply); goto bailout; diff --git a/gpsd_json.c b/gpsd_json.c index d949970f..d6fda692 100644 --- a/gpsd_json.c +++ b/gpsd_json.c @@ -350,7 +350,7 @@ void json_watch_dump(const struct policy_t *ccp, ccp->timing ? "true" : "false"); if (ccp->devpath[0] != '\0') (void)snprintf(reply + strlen(reply), replylen - strlen(reply), - "\"device\":%s,", ccp->devpath); + "\"device\":\"%s\",", ccp->devpath); if (reply[strlen(reply) - 1] == ',') reply[strlen(reply) - 1] = '\0'; (void)strlcat(reply, "}\r\n", replylen - strlen(reply)); diff --git a/libgps_core.c b/libgps_core.c index c47f5155..e9890fe5 100644 --- a/libgps_core.c +++ b/libgps_core.c @@ -682,7 +682,7 @@ int gps_stream(struct gps_data_t *gpsdata, unsigned int flags, /*@-nullpass@*//* shouldn't be needed, splint has a bug */ if (flags & WATCH_DEVICE) (void)snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), - "\"device\":%s,", (char *)d); + "\"device\":\"%s\",", (char *)d); /*@+nullpass@*/ if (buf[strlen(buf) - 1] == ',') buf[strlen(buf) - 1] = '\0'; |