diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2009-05-05 17:20:49 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2009-05-05 17:20:49 +0000 |
commit | c838853519bb4916de178fe94a2d327c30dbabda (patch) | |
tree | ba3d8c0f6c44d0e6c596f475b07da7d7d4da3854 /hex.c | |
parent | 827953c4c984711f102b8f03cb976179864efaef (diff) | |
download | gpsd-c838853519bb4916de178fe94a2d327c30dbabda.tar.gz |
Don't clobber the destination of gpsd_hexpack; thanks to Joshua
Lamorie for spotting this.
Diffstat (limited to 'hex.c')
-rw-r--r-- | hex.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -61,12 +61,12 @@ int gpsd_hexpack(char *src, char *dst, size_t len){ if ((l < 1) || ((size_t)l > len)) return -2; - bzero(dst, (int)len); for (i = 0; i < l; i++) if ((k = hex2bin(src+i*2)) != -1) dst[i] = (char)(k & 0xff); else return -1; + (void)memset(dst+i, '\0', (size_t)(len-i)); return l; /*@ +mustdefine @*/ } |