From 4abdcf1ac9a891a5010f238214150adbc2073b38 Mon Sep 17 00:00:00 2001 From: Zbigniew Chyla Date: Fri, 16 Jan 2015 15:46:59 +0100 Subject: Add str_{,v}appendf, use it everywhere. This change doesn't affect generated binary code. --- driver_tsip.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'driver_tsip.c') diff --git a/driver_tsip.c b/driver_tsip.c index 92c8effb..a3136fbd 100644 --- a/driver_tsip.c +++ b/driver_tsip.c @@ -23,6 +23,7 @@ #include "gpsd.h" #include "bits.h" +#include "strfuncs.h" #include @@ -156,8 +157,7 @@ static gps_mask_t tsip_parse_input(struct gps_device_t *session) if (session->lexer.outbuffer[++i] == 0x03) break; - (void)snprintf(buf2 + strlen(buf2), - sizeof(buf2) - strlen(buf2), + str_appendf(buf2, sizeof(buf2), "%02x", buf[len++] = session->lexer.outbuffer[i]); } /*@ -charint @*/ @@ -346,8 +346,7 @@ static gps_mask_t tsip_parse_input(struct gps_device_t *session) session->gpsdata.skyview[j].ss = f1; break; } - (void)snprintf(buf2 + strlen(buf2), sizeof(buf2) - strlen(buf2), - " %d=%.1f", (int)u1, f1); + str_appendf(buf2, sizeof(buf2), " %d=%.1f", (int)u1, f1); } gpsd_report(&session->context->errout, LOG_PROG, "Signal Levels (%d):%s\n", count, buf2); @@ -578,7 +577,7 @@ static gps_mask_t tsip_parse_input(struct gps_device_t *session) buf2[0] = '\0'; /*@ +charint @*/ for (i = 0; i < count; i++) - (void)snprintf(buf2 + strlen(buf2), sizeof(buf2) - strlen(buf2), + str_appendf(buf2, sizeof(buf2), " %d", session->driver.tsip.sats_used[i] = (int)getub(buf, 17 + i)); /*@ -charint @*/ -- cgit v1.2.1