diff options
author | Wim Taymans <wtaymans@redhat.com> | 2020-08-03 10:10:04 +0200 |
---|---|---|
committer | Wim Taymans <wtaymans@redhat.com> | 2020-08-03 10:10:04 +0200 |
commit | a655e8f6df49ea7ec5231b9606357f3f44ef2b55 (patch) | |
tree | 6ea510f4a0e4533d174667a28b4a9cea83d7d0a7 | |
parent | 2d76a00e209159a285da48551408988f1de24968 (diff) |
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'.
-rw-r--r-- | spa/plugins/alsa/acp/alsa-util.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/spa/plugins/alsa/acp/alsa-util.c b/spa/plugins/alsa/acp/alsa-util.c index e192676f..3cb356e4 100644 --- a/spa/plugins/alsa/acp/alsa-util.c +++ b/spa/plugins/alsa/acp/alsa-util.c @@ -1443,7 +1443,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) { |