source: trunk/sys/dietlibc/mbsrtowcs.c @ 270

Last change on this file since 270 was 1, checked in by alain, 8 years ago

First import

File size: 324 bytes
RevLine 
[1]1#include <wchar.h>
2
3size_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.