From: Jaroslav Kysela Date: Mon, 11 Jan 2021 09:44:38 +0000 (+0100) Subject: alsamixer: fix shift in parse_words() X-Git-Tag: v1.2.5~86 X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=19cc5daef42c84bdadbaa25d1c4e1da33eeae3cc;p=alsa-utils.git alsamixer: fix shift in parse_words() Signed-off-by: Jaroslav Kysela --- diff --git a/alsamixer/configparser.c b/alsamixer/configparser.c index 93aa72a..7647987 100644 --- a/alsamixer/configparser.c +++ b/alsamixer/configparser.c @@ -155,7 +155,7 @@ const char *mixer_words = static unsigned int parse_words(const char *name, const char* wordlist, unsigned int itemlen, unsigned int *number) { unsigned int words = 0; unsigned int word; - unsigned int i; + int i; char buf[16]; char *endptr; @@ -181,7 +181,7 @@ static unsigned int parse_words(const char *name, const char* wordlist, unsigned word = W_NUMBER; } else if ((i = strlist_index(wordlist, itemlen, buf)) >= 0) - word = 2U << i; + word = i <= 30 ? (2U << i) : 0; else return 0;