summaryrefslogtreecommitdiff
path: root/hex.c
diff options
context:
space:
mode:
Diffstat (limited to 'hex.c')
-rw-r--r--hex.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/hex.c b/hex.c
index cc22da79..4bbc950e 100644
--- a/hex.c
+++ b/hex.c
@@ -17,8 +17,8 @@ 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;
+ if (NULL == binbuf || 0 == binbuflen)
+ return "";
/*@ -shiftimplementation @*/
for (i = 0; i < len; i++) {