diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2009-09-17 08:48:43 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2009-09-17 08:48:43 +0000 |
commit | 9cdbb998794f19a64b5597002cbf8ade0938357a (patch) | |
tree | 959a565eff9ecfa9c4602dfb3431fe102b8f894c | |
parent | b7061f11db8ed4bbfe68a5638cd36a0282fead25 (diff) | |
download | gpsd-9cdbb998794f19a64b5597002cbf8ade0938357a.tar.gz |
Suppress excess \r\n in ?DEVICES output.
-rw-r--r-- | gpsd.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -1618,8 +1618,12 @@ static void json_devicelist_dump(char *reply, size_t replylen) "{\"class\":\"DEVICES\",\"devices\":[", replylen); for (devp = devices; devp < devices + MAXDEVICES; devp++) if (allocated_device(devp) && strlen(reply)+strlen(devp->gpsdata.dev.path)+3 < replylen-1) { + char *cp; json_device_dump(devp, reply+strlen(reply), replylen-strlen(reply)); + cp = reply + strlen(reply); + *--cp = '\0'; + *--cp = '\0'; (void)strlcat(reply, ",", replylen); } |