diff options
author | Zbigniew Chyla <zbigniew.chyla@nsn.com> | 2015-01-16 15:46:59 +0100 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2015-01-21 10:47:26 -0500 |
commit | 4abdcf1ac9a891a5010f238214150adbc2073b38 (patch) | |
tree | ccd55b9a74504246569a0d84d7853370541cad34 /gpsmon.c | |
parent | b500289f7af867ee5d5c236247f8f8a2a48ad342 (diff) | |
download | gpsd-4abdcf1ac9a891a5010f238214150adbc2073b38.tar.gz |
Add str_{,v}appendf, use it everywhere.
This change doesn't affect generated binary code.
Diffstat (limited to 'gpsmon.c')
-rw-r--r-- | gpsmon.c | 6 |
1 files changed, 2 insertions, 4 deletions
@@ -203,8 +203,7 @@ static void cond_hexdump(/*@out@*/char *buf2, size_t len2, } else { buf2[0] = '\0'; for (i = 0; i < len; i++) - (void)snprintf(buf2 + strlen(buf2), len2 - strlen(buf2), - "%02x", (unsigned int)(buf[i] & 0xff)); + str_appendf(buf2, len2, "%02x", (unsigned int)(buf[i] & 0xff)); } } /*@+compdef +mustdefine@*/ @@ -1184,8 +1183,7 @@ int main(int argc, char **argv) sizeof(session.gpsdata.dev.path)); else session.gpsdata.dev.path[0] = '\0'; - (void)snprintf(session.gpsdata.dev.path + strlen(session.gpsdata.dev.path), - sizeof(session.gpsdata.dev.path) - strlen(session.gpsdata.dev.path), + str_appendf(session.gpsdata.dev.path, sizeof(session.gpsdata.dev.path), "%s:%s", source.server, source.port); } |