[alsa-devel] [PATCH 10/11] ucm: fix handling of cset with spaces in the control name

Liam Girdwood lrg at slimlogic.co.uk
Tue Dec 21 23:11:59 CET 2010


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 |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/ucm/main.c b/src/ucm/main.c
index 5f44461..7305042 100644
--- a/src/ucm/main.c
+++ b/src/ucm/main.c
@@ -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;
-- 
1.7.1



More information about the Alsa-devel mailing list