diff options
author | Arun Raghavan <arun.raghavan@collabora.co.uk> | 2012-07-17 15:30:14 +0530 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2012-07-17 14:55:55 +0200 |
commit | df924cd9c5dd5ab079784faec344cdfd11f3147a (patch) | |
tree | 79293772ec471c1e5bb273e6b8a7d2a74fa37b10 | |
parent | 86e27cdbf119440101a850e1b44baebfefe863ca (diff) | |
download | alsa-lib-df924cd9c5dd5ab079784faec344cdfd11f3147a.tar.gz |
control: Use strcpy() instead of stpcpy()
This allows us to build in environments that don't provide stpcpy().
This makes it necessary to traverse the string twice, but should not be
noticeable in clients since this function is very unlikely to be part of
a performance-critical path.
[coding style fixed by tiwai]
Signed-off-by: Arun Raghavan <arun.raghavan@collabora.co.uk>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r-- | src/control/control.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/control/control.c b/src/control/control.c index a0965c6c..66277efe 100644 --- a/src/control/control.c +++ b/src/control/control.c @@ -417,8 +417,10 @@ int snd_ctl_elem_add_enumerated(snd_ctl_t *ctl, const snd_ctl_elem_id_t *id, info->value.enumerated.names_ptr = (uintptr_t)buf; info->value.enumerated.names_length = bytes; p = buf; - for (i = 0; i < items; ++i) - p = stpcpy(p, names[i]) + 1; + for (i = 0; i < items; ++i) { + strcpy(p, names[i]); + p += strlen(names[i]) + 1; + } err = ctl->ops->element_add(ctl, info); |