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