]> git.alsa-project.org Git - alsa-lib.git/commitdiff
ucm: fix handling of cset with spaces in the control name
authorLiam Girdwood <lrg@slimlogic.co.uk>
Tue, 21 Dec 2010 22:11:59 +0000 (23:11 +0100)
committerJaroslav Kysela <perex@perex.cz>
Wed, 22 Dec 2010 07:06:28 +0000 (08:06 +0100)
Always terminate the cset command based on the last space found within the
cset command since the control name may contain spaces.

src/ucm/main.c

index 5f44461f75001cdb97c837fab50fb9e459d69504..730504273d891589d526ecd8fa3442e5e909c094 100644 (file)
@@ -168,7 +168,7 @@ static int execute_cset(snd_ctl_t *ctl, char *cset)
        snd_ctl_elem_value_malloc(&value);
        snd_ctl_elem_info_malloc(&info);
 
-       pos = strchr(cset, ' ');
+       pos = strrchr(cset, ' ');
        if (pos == NULL) {
                uc_error("undefined value for cset >%s<", cset);
                return -EINVAL;