[pulseaudio-commits] [Git][pulseaudio/pulseaudio][master] alsa-util: fix check for digit

Arun Raghavan gitlab at gitlab.freedesktop.org
Mon Aug 3 12:09:48 UTC 2020



Arun Raghavan pushed to branch master at PulseAudio / pulseaudio


Commits:
4d1e5686 by Wim Taymans at 2020-08-03T09:58:39+02:00
alsa-util: fix check for digit

Fix the check for a digit by checking if the value is between the
*character* '0' (not *value* 0) and '9'.

- - - - -


1 changed file:

- src/modules/alsa/alsa-util.c


Changes:

=====================================
src/modules/alsa/alsa-util.c
=====================================
@@ -1752,7 +1752,7 @@ snd_mixer_t *pa_alsa_open_mixer_by_name(pa_hashmap *mixers, const char *dev, boo
     if (!pm && pa_strneq(dev, "hw:", 3)) {
         const char *s = dev + 3;
         int card_index;
-        while (*s && *s >= 0 && *s <= '9') s++;
+        while (*s && *s >= '0' && *s <= '9') s++;
         if (*s == '\0' && pa_atoi(dev + 3, &card_index) >= 0) {
             PA_HASHMAP_FOREACH_KV(dev2, pm, mixers, state) {
                 if (pm->card_index == card_index) {



View it on GitLab: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/commit/4d1e5686194d5c6671e3023b5e55a4043d6e1824

-- 
View it on GitLab: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/commit/4d1e5686194d5c6671e3023b5e55a4043d6e1824
You're receiving this email because of your account on gitlab.freedesktop.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/pulseaudio-commits/attachments/20200803/7229dff2/attachment.htm>


More information about the pulseaudio-commits mailing list