From 70d4b266990aad3715f16c94d8db10a600359127 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Wed, 9 Oct 2013 16:06:35 +0200 Subject: [PATCH] monitor: Allow zero-length hex fields with print_hex_field() --- monitor/l2cap.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/monitor/l2cap.c b/monitor/l2cap.c index 2e49e32be..666f4467d 100644 --- a/monitor/l2cap.c +++ b/monitor/l2cap.c @@ -1626,6 +1626,8 @@ static void print_hex_field(const char *label, const uint8_t *data, char str[len * 2 + 1]; uint8_t i; + str[0] = '\0'; + for (i = 0; i < len; i++) sprintf(str + (i * 2), "%2.2x", data[i]); -- 2.47.3