diff options
Diffstat (limited to 'hex.c')
-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 ]; |