Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
/* add length of preamble + one for NUL - one for last (missing) comma */
length += strlen(preamble);
/* add length of preamble + one for NUL - one for last (missing) comma */
length += strlen(preamble);
+ ret = zmalloc(length);
+ if (!ret) {
+ return NULL;
+ }
strncpy(ret, preamble, length);
for (i = 0; i < count; i++) {
strcat(ret, names[i]);
strncpy(ret, preamble, length);
for (i = 0; i < count; i++) {
strcat(ret, names[i]);