topology: fix nibble warning in tplg_save_quoted()
Some checks are pending
Build alsa-lib / fedora_latest_build (push) Waiting to run
Build alsa-lib / ubuntu_last_build (push) Waiting to run

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
Jaroslav Kysela 2025-11-03 16:12:07 +01:00
parent 11a716d1d0
commit fa6e83d780

View file

@ -226,9 +226,14 @@ static int tplg_check_quoted(const unsigned char *p)
return 0;
}
static unsigned char nibble(unsigned char b)
{
b &= 0x0f;
return b < 10 ? b + '0' : b + 'a';
}
static int tplg_save_quoted(struct tplg_buf *dst, const char *str)
{
static const char nibble[16] = "0123456789abcdef";
unsigned char *p, *d, *t;
int c;
@ -270,8 +275,8 @@ static int tplg_save_quoted(struct tplg_buf *dst, const char *str)
} else {
*t++ = '\\';
*t++ = 'x';
*t++ = nibble[(c >> 4) & 0x0f];
*t++ = nibble[(c >> 0) & 0x0f];
*t++ = nibble(c >> 4);
*t++ = nibble(c >> 0);
}
break;
}