toaruos/libc/wchar/wcs.c
2018-06-25 18:15:02 +09:00

26 lines
363 B
C

#include <wchar.h>
size_t wcstombs(char * dest, const wchar_t *src, size_t n) {
/* TODO */
size_t c = 0;
while (c < n && *src) {
*dest = *src;
c++;
src++;
dest++;
}
return c;
}
size_t mbstowcs(wchar_t * dest, const char *src, size_t n) {
/* TODO */
size_t c = 0;
while (c < n && *src) {
*dest = *src;
c++;
src++;
dest++;
}
return c;
}