reactos/lib/sdk/crt/stdlib/mbstowcs.c
Cameron Gutman 29fa274d6d - Create another branch for networking fixes
- TSVN choked repeatedly when attempting to merge ~9000 revs into the branch (tried 3 times on 2 different computers)
 - If someone wants to delete aicom-network-fixes, they are welcome to
 - Lesson learned: Letting a branch get thousands of revs out of date is a horrible idea

svn path=/branches/aicom-network-branch/; revision=44353
2009-12-02 03:23:19 +00:00

28 lines
403 B
C

#include <precomp.h>
/*
* @implemented
*/
size_t mbstowcs (wchar_t *widechar, const char *multibyte, size_t number)
{
int bytes;
size_t n = 0;
while (n < number) {
if ((bytes = mbtowc (widechar, multibyte, MB_LEN_MAX)) < 0)
return (size_t) -1;
if (bytes == 0) {
*widechar = (wchar_t) '\0';
return n;
}
widechar++;
multibyte += bytes;
n++;
}
return n;
}