diff options
author | Johan Hedberg <johan.hedberg@intel.com> | 2013-10-10 14:49:09 +0300 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@intel.com> | 2013-10-10 14:49:35 +0300 |
commit | f7773c7247e1cf460d4c816f05b8a82391a59cf9 (patch) | |
tree | 149ed909099a38628efd526259cf501e19c2887d /monitor | |
parent | 31324f41b2121dda2a0f132fe50c30cb831aa837 (diff) |
monitor: Fix zero-length field handling in print_hex_field
Diffstat (limited to 'monitor')
-rw-r--r-- | monitor/packet.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/monitor/packet.c b/monitor/packet.c index fae61611f..9badfcdc0 100644 --- a/monitor/packet.c +++ b/monitor/packet.c @@ -1185,6 +1185,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]); |