source:
trunk/sys/dietlibc/mbsrtowcs.c
@
361
Last change on this file since 361 was 1, checked in by , 8 years ago | |
---|---|
File size: 324 bytes |
Rev | Line | |
---|---|---|
[1] | 1 | #include <wchar.h> |
2 | ||
3 | size_t mbsrtowcs(wchar_t *dest, const char **src, size_t len, mbstate_t *ps) { | |
4 | const char* orig=*src; | |
5 | size_t i; | |
6 | if (!dest) len=(size_t)-1; | |
7 | for (i=0; i<len; ++i) { | |
8 | size_t n=mbrtowc(dest?dest+i:0,*src,len,ps); | |
9 | if (n==(size_t)-1) return -1; | |
10 | if (!n) break; | |
11 | *src+=n; | |
12 | } | |
13 | return i; | |
14 | } |
Note: See TracBrowser
for help on using the repository browser.