summaryrefslogtreecommitdiff
path: root/libgpsd_core.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2005-07-19 15:56:57 +0000
committerEric S. Raymond <esr@thyrsus.com>2005-07-19 15:56:57 +0000
commit0ade5ab3e40e0ecee67c85ebe129f77582149285 (patch)
treed4144c96d0a5ca8c03d5a8d0b22c6e89fa783f31 /libgpsd_core.c
parent976bba0b99600a42a58a134aeb98c0023877926e (diff)
downloadgpsd-0ade5ab3e40e0ecee67c85ebe129f77582149285.tar.gz
Add progress messages to gpsflash. splint cleanup.
Diffstat (limited to 'libgpsd_core.c')
-rw-r--r--libgpsd_core.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libgpsd_core.c b/libgpsd_core.c
index ba522ae1..3df97ead 100644
--- a/libgpsd_core.c
+++ b/libgpsd_core.c
@@ -636,16 +636,16 @@ void gpsd_zero_satellites(/*@out@*/struct gps_data_t *out)
out->satellites = 0;
}
-char *gpsd_hexdump(void *binbuf, size_t binbuflen)
+char /*@ observer @*/ *gpsd_hexdump(void *binbuf, size_t binbuflen)
{
static char hexbuf[MAX_PACKET_LENGTH*2+1];
size_t i;
- size_t len = (binbuflen > MAX_PACKET_LENGTH) ? MAX_PACKET_LENGTH : binbuflen;
+ size_t len = (size_t)((binbuflen > MAX_PACKET_LENGTH) ? MAX_PACKET_LENGTH : binbuflen);
char *ibuf = (char *)binbuf;
memset(hexbuf, 0, 3 * len + 1);
for (i = 0; i < len; i++) {
- (void)sprintf(hexbuf + (3 * i), "%02x", (unsigned char)ibuf[i]);
+ (void)snprintf(hexbuf + (3 * i), 4, "%02x", (unsigned int)ibuf[i]);
}
return hexbuf;
}