diff options
author | Chris Kuethe <chris.kuethe@gmail.com> | 2007-04-14 05:49:48 +0000 |
---|---|---|
committer | Chris Kuethe <chris.kuethe@gmail.com> | 2007-04-14 05:49:48 +0000 |
commit | e4107acb3961e60f0fa34591e25276735bdba610 (patch) | |
tree | b27950122e3b37e3dc9d57edc796322c7a06d340 | |
parent | 27cc8fd65443c48de05479f9635f9db98d2ad006 (diff) | |
download | gpsd-e4107acb3961e60f0fa34591e25276735bdba610.tar.gz |
shift blame... passing in a NULL gets you a NULL back.
calling functions should be more careful
-rw-r--r-- | hex.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -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 ]; |