summaryrefslogtreecommitdiff
path: root/driver_tsip.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 /driver_tsip.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 'driver_tsip.c')
-rw-r--r--driver_tsip.c9
1 files changed, 4 insertions, 5 deletions
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 <sys/select.h>
@@ -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 @*/