mirror of
https://github.com/reactos/reactos.git
synced 2024-11-18 21:13:52 +00:00
- Update fputwc implementation to current wine sources
- Fixes 23 msvcrt file winetests svn path=/trunk/; revision=38185
This commit is contained in:
parent
855ea53e48
commit
f45ee646df
1 changed files with 4 additions and 22 deletions
|
@ -2167,27 +2167,9 @@ size_t CDECL fwrite(const void *ptr, size_t size, size_t nmemb, FILE* file)
|
|||
*/
|
||||
wint_t CDECL fputwc(wint_t wc, FILE* file)
|
||||
{
|
||||
if (file->_flag & _IOBINARY)
|
||||
{
|
||||
if (fwrite(&wc, sizeof(wc), 1, file) != 1)
|
||||
wchar_t mwc=wc;
|
||||
if (fwrite( &mwc, sizeof(mwc), 1, file) != 1)
|
||||
return WEOF;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Convert to multibyte in text mode */
|
||||
char mbc[MB_LEN_MAX];
|
||||
int mb_return;
|
||||
|
||||
mb_return = wctomb(mbc, wc);
|
||||
|
||||
if(mb_return == -1)
|
||||
return WEOF;
|
||||
|
||||
/* Output all characters */
|
||||
if (fwrite(mbc, mb_return, 1, file) != 1)
|
||||
return WEOF;
|
||||
}
|
||||
|
||||
return wc;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue