. use library function to parse memory string
[minix3.git] / lib / ansi / strxfrm.c
blobca32913e0e6d51e53eaa5ea903a309a21c04fa1d
1 /*
2 * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
3 * See the copyright notice in the ACK home directory, in the file "Copyright".
4 */
5 /* $Header$ */
7 #include <string.h>
9 size_t
10 strxfrm(register char *s1, register const char *save, register size_t n)
12 register const char *s2 = save;
14 while (*s2) {
15 if (n > 1) {
16 n--;
17 *s1++ = *s2++;
18 } else
19 s2++;
21 if (n > 0)
22 *s1++ = '\0';
23 return s2 - save;