2 * Copyright 2000, International Business Machines Corporation and others.
5 * This software has been released under the terms of the IBM Public
6 * License. For details, see the LICENSE file in the top-level source
7 * directory or online at http://www.openafs.org/dl/license10.html
10 #include <afsconfig.h>
11 #include <afs/param.h>
21 /* Just like strncpy but shift-case in transit and forces null termination */
23 lcstring(char *d, char *s, int n)
28 if ((s == 0) || (d == 0))
29 return 0; /* just to be safe */
36 break; /* quit after transferring null */
38 *(d - 1) = 0; /* make sure null terminated */
44 ucstring(char *d, char *s, int n)
49 if ((s == 0) || (d == 0))
59 *(d - 1) = 0; /* make sure null terminated */
86 /* strcompose - concatenate strings passed to it.
88 * buf: storage for the composed string. Any data in it will be lost.
89 * len: length of the buffer.
90 * ...: variable number of string arguments. The last argument must be
92 * Returns buf or NULL if the buffer was not sufficiently large.
95 strcompose(char *buf, size_t len, ...)
98 size_t spaceleft = len - 1;
102 if (buf == NULL || len <= 0)
107 str = va_arg(ap, char *);
110 if (spaceleft < slen) /* not enough space left */
116 str = va_arg(ap, char *);