summaryrefslogtreecommitdiff
path: root/hex.c
diff options
context:
space:
mode:
authorChris Kuethe <chris.kuethe@gmail.com>2007-04-14 05:49:48 +0000
committerChris Kuethe <chris.kuethe@gmail.com>2007-04-14 05:49:48 +0000
commite4107acb3961e60f0fa34591e25276735bdba610 (patch)
treeb27950122e3b37e3dc9d57edc796322c7a06d340 /hex.c
parent27cc8fd65443c48de05479f9635f9db98d2ad006 (diff)
downloadgpsd-e4107acb3961e60f0fa34591e25276735bdba610.tar.gz
shift blame... passing in a NULL gets you a NULL back.
calling functions should be more careful
Diffstat (limited to 'hex.c')
-rw-r--r--hex.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/hex.c b/hex.c
index c29d63b7..cc22da79 100644
--- a/hex.c
+++ b/hex.c
@@ -17,6 +17,9 @@ char /*@ observer @*/ *gpsd_hexdump(const void *binbuf, size_t binbuflen)
const char *ibuf = (const char *)binbuf;
const char *hexchar = "0123456789abcdef";
+ if (NULL == binbuf)
+ return NULL;
+
/*@ -shiftimplementation @*/
for (i = 0; i < len; i++) {
hexbuf[j++] = hexchar[ (ibuf[i]&0xf0)>>4 ];