mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-10-29 05:40:23 -04: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'.
This commit is contained in:
parent
47d811224d
commit
4d1e568619
1 changed files with 1 additions and 1 deletions
|
|
@ -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)) {
|
if (!pm && pa_strneq(dev, "hw:", 3)) {
|
||||||
const char *s = dev + 3;
|
const char *s = dev + 3;
|
||||||
int card_index;
|
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) {
|
if (*s == '\0' && pa_atoi(dev + 3, &card_index) >= 0) {
|
||||||
PA_HASHMAP_FOREACH_KV(dev2, pm, mixers, state) {
|
PA_HASHMAP_FOREACH_KV(dev2, pm, mixers, state) {
|
||||||
if (pm->card_index == card_index) {
|
if (pm->card_index == card_index) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue