summaryrefslogtreecommitdiff
path: root/gpsmon.c
diff options
context:
space:
mode:
authorZbigniew Chyla <zbigniew.chyla@nsn.com>2015-01-16 15:46:59 +0100
committerEric S. Raymond <esr@thyrsus.com>2015-01-21 10:47:26 -0500
commit4abdcf1ac9a891a5010f238214150adbc2073b38 (patch)
treeccd55b9a74504246569a0d84d7853370541cad34 /gpsmon.c
parentb500289f7af867ee5d5c236247f8f8a2a48ad342 (diff)
downloadgpsd-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.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/gpsmon.c b/gpsmon.c
index e10afc82..549628a6 100644
--- a/gpsmon.c
+++ b/gpsmon.c
@@ -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);
}