Fix more wchar

This commit is contained in:
K. Lange 2018-06-25 20:43:34 +09:00
parent 251bd8d0c0
commit 33b87a9de9
2 changed files with 3 additions and 1 deletions

View File

@ -9,6 +9,7 @@ size_t wcstombs(char * dest, const wchar_t *src, size_t n) {
src++; src++;
dest++; dest++;
} }
*dest = 0;
return c; return c;
} }
@ -21,5 +22,6 @@ size_t mbstowcs(wchar_t * dest, const char *src, size_t n) {
src++; src++;
dest++; dest++;
} }
*dest = 0;
return c; return c;
} }

View File

@ -41,7 +41,7 @@ wchar_t * wcschr(const wchar_t *wcs, wchar_t wc) {
wchar_t * wcsrchr(const wchar_t *wcs, wchar_t wc) { wchar_t * wcsrchr(const wchar_t *wcs, wchar_t wc) {
wchar_t * last = NULL; wchar_t * last = NULL;
while (*wcs != L'0') { while (*wcs != 0) {
if (*wcs == wc) { if (*wcs == wc) {
last = (wchar_t *)wcs; last = (wchar_t *)wcs;
} }