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>
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);