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>
19 /* Just like strncpy but shift-case in transit and forces null termination */
21 lcstring(char *d, const char *s, int n)
26 opr_Assert(s != NULL && d != NULL);
33 break; /* quit after transferring null */
35 *(d - 1) = 0; /* make sure null terminated */
41 ucstring(char *d, const char *s, int n)
46 opr_Assert(s != NULL && d != NULL);
55 *(d - 1) = 0; /* make sure null terminated */
82 /* strcompose - concatenate strings passed to it.
84 * buf: storage for the composed string. Any data in it will be lost.
85 * len: length of the buffer.
86 * ...: variable number of string arguments. The last argument must be
88 * Returns buf or NULL if the buffer was not sufficiently large.
91 strcompose(char *buf, size_t len, ...)
94 size_t spaceleft = len - 1;
98 opr_Assert(buf != NULL);
104 str = va_arg(ap, char *);
107 if (spaceleft < slen) /* not enough space left */
113 str = va_arg(ap, char *);