When displaying TLV binary values, as in this example:
TLV Name Code Len Value
-------------------- ---- --- -----
Product Name 0x21 6 my-product
Vendor Extension 0xFD 6 0x66 0x6F 0x6F 0x62 0x61 0x72
CRC-32 0xFE 4 0x3CAAF7AE
There is a leading space before the first byte.
Fix by not printing the space character for the first value.
Signed-off-by: Hugo Villeneuve <hvilleneuve@dimonoff.com>
i++) {
char dec_val[DECODE_VALUE_MAX];
- sprintf(dec_val, " 0x%02X", tlv->value[i]);
+ sprintf(dec_val, "0x%02X", tlv->value[i]);
+
+ if (i != 0)
+ strcat(value, " ");
+
strcat(value, dec_val);
}
break;