monitor: Allow zero-length hex fields with print_hex_field()

This commit is contained in:
Johan Hedberg 2013-10-09 16:06:35 +02:00
parent 1a82ad4108
commit 70d4b26699

View File

@ -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]);