msvcrt: Use fputwc to output characters to file in fprintf functions.
This commit is contained in:
parent
77f3ce0b10
commit
a8c2ae1751
|
@ -4208,7 +4208,25 @@ static int puts_clbk_file_a(void *file, int len, const char *str)
|
||||||
|
|
||||||
static int puts_clbk_file_w(void *file, int len, const MSVCRT_wchar_t *str)
|
static int puts_clbk_file_w(void *file, int len, const MSVCRT_wchar_t *str)
|
||||||
{
|
{
|
||||||
return MSVCRT_fwrite(str, sizeof(MSVCRT_wchar_t), len, file);
|
int i, ret;
|
||||||
|
|
||||||
|
MSVCRT__lock_file(file);
|
||||||
|
|
||||||
|
if(!(msvcrt_get_ioinfo(((MSVCRT_FILE*)file)->_file)->wxflag & WX_TEXT)) {
|
||||||
|
ret = MSVCRT_fwrite(str, sizeof(MSVCRT_wchar_t), len, file);
|
||||||
|
MSVCRT__unlock_file(file);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
for(i=0; i<len; i++) {
|
||||||
|
if(MSVCRT_fputwc(str[i], file) == MSVCRT_WEOF) {
|
||||||
|
MSVCRT__unlock_file(file);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
MSVCRT__unlock_file(file);
|
||||||
|
return len;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*********************************************************************
|
/*********************************************************************
|
||||||
|
|
Loading…
Reference in New Issue