[alsa-devel] [PATCH 11/11] ucm: ctlparse - always terminate cset buffer

Liam Girdwood lrg at slimlogic.co.uk
Tue Dec 21 23:12:00 CET 2010


Signed-off-by: Liam Girdwood <lrg at slimlogic.co.uk>
---
 src/control/ctlparse.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/control/ctlparse.c b/src/control/ctlparse.c
index c8300f3..a929816 100644
--- a/src/control/ctlparse.c
+++ b/src/control/ctlparse.c
@@ -208,8 +208,8 @@ int snd_ctl_ascii_elem_id_parse(snd_ctl_elem_id_t *dst, const char *str)
 					}
 					str++;
 				}
-				*ptr = '\0';
 			}
+			*ptr = '\0';
 			snd_ctl_elem_id_set_name(dst, buf);
 		} else if (!strncasecmp(str, "index=", 6)) {
 			str += 6;
-- 
1.7.1



More information about the Alsa-devel mailing list