summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--gatchat/gatutil.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/gatchat/gatutil.c b/gatchat/gatutil.c
index 768490b2..6a7bb4b6 100644
--- a/gatchat/gatutil.c
+++ b/gatchat/gatutil.c
@@ -140,6 +140,9 @@ void g_at_util_debug_hexdump(gboolean in, const unsigned char *buf, gsize len,
char str[68];
gsize i;
+ if (debugf == NULL || !len)
+ return;
+
str[0] = in ? '<' : '>';
for (i = 0; i < len; i++) {