From d45a2be9eaba2bb75840ca7c19bccc4d6578270b Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Sun, 24 Nov 2024 20:02:51 +0100 Subject: [PATCH] amixer: fix unknown TVL sequence print Closes: https://github.com/alsa-project/alsa-utils/issues/282 Signed-off-by: Jaroslav Kysela --- amixer/amixer.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/amixer/amixer.c b/amixer/amixer.c index 8b8000b37..07e9819e5 100644 --- a/amixer/amixer.c +++ b/amixer/amixer.c @@ -587,10 +587,17 @@ static void decode_tlv(unsigned int spaces, unsigned int *tlv, unsigned int tlv_ #endif default: printf("unk-%u-", type); - while (size > 0) { + while (size > sizeof(unsigned int)) { printf("0x%08x,", tlv[idx++]); size -= sizeof(unsigned int); } + if (size > 0) { + unsigned char *b = (void *)&tlv[idx]; + while (size > 0) { + printf("E-0x%02x,", *b++); + size--; + } + } break; } if (lf)