9 /* #include <stringops.h>
11 /* char *concatenate(str, ...)
14 /* The \fBconcatenate\fR routine concatenates a null-terminated
15 /* list of pointers to null-terminated character strings.
16 /* The result is dynamically allocated and should be passed to myfree()
17 /* when no longer needed.
21 /* The Secure Mailer license must be distributed with this software.
24 /* IBM T.J. Watson Research
26 /* Yorktown Heights, NY 10598, USA
32 #include <stdlib.h> /* 44BSD stdarg.h uses abort() */
36 /* Utility library. */
39 #include "stringops.h"
41 /* concatenate - concatenate null-terminated list of strings */
43 char *concatenate(const char *arg0
,...)
51 * Compute the length of the resulting string.
55 while ((arg
= va_arg(ap
, char *)) != 0)
60 * Build the resulting string. Don't care about wasting a CPU cycle.
62 result
= mymalloc(len
+ 1);
65 while ((arg
= va_arg(ap
, char *)) != 0)