. use library function to parse memory string
[minix3.git] / lib / ansi / wcstombs.c
blob91a14624dfef157739a916bf306764a56d3a2f25
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 <stdlib.h>
8 #include <locale.h>
9 #include <limits.h>
11 size_t
12 wcstombs(register char *s, register const wchar_t *pwcs, size_t n)
14 register int i = n;
16 while (--i >= 0) {
17 if (!(*s++ = *pwcs++))
18 break;
20 return n - i - 1;