diff mbox

[1/2] amixer: Make "dB" case-insensitive in set commands

Message ID 1416734162-24748-1-git-send-email-tiwai@suse.de (mailing list archive)
State New, archived
Headers show

Commit Message

Takashi Iwai Nov. 23, 2014, 9:16 a.m. UTC
We don't have to be necessarily too strict about case-sensitivity of
"dB" suffix used in set commands.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
 amixer/amixer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox

Patch

diff --git a/amixer/amixer.c b/amixer/amixer.c
index cf82892bfa2f..6a2fdb96c62f 100644
--- a/amixer/amixer.c
+++ b/amixer/amixer.c
@@ -346,7 +346,7 @@  static int set_volume_simple(snd_mixer_elem_t *elem,
 	if (*p == '%') {
 		percent = 1;
 		p++;
-	} else if (p[0] == 'd' && p[1] == 'B') {
+	} else if (toupper(p[0]) == 'D' && toupper(p[1]) == 'B') {
 		vol_type = VOL_DB;
 		p += 2;
 		scale = 100;