mirror of
https://github.com/reactos/reactos.git
synced 2025-08-06 11:22:58 +00:00
Create a branch for header work.
svn path=/branches/header-work/; revision=45691
This commit is contained in:
parent
14fe274b1c
commit
9ea495ba33
19538 changed files with 0 additions and 1063950 deletions
28
lib/sdk/crt/stdlib/mbstowcs.c
Normal file
28
lib/sdk/crt/stdlib/mbstowcs.c
Normal file
|
@ -0,0 +1,28 @@
|
|||
#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;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue