summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gpsd.c15
-rw-r--r--gpsd_json.c2
-rw-r--r--libgps_core.c2
3 files changed, 10 insertions, 9 deletions
diff --git a/gpsd.c b/gpsd.c
index 8c7fcf5c..1367b7d0 100644
--- a/gpsd.c
+++ b/gpsd.c
@@ -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';