Author: gschneider
Date: Fri Dec 19 10:57:48 2008
New Revision: 38185
URL:
http://svn.reactos.org/svn/reactos?rev=38185&view=rev
Log:
- Update fputwc implementation to current wine sources
- Fixes 23 msvcrt file winetests
Modified:
trunk/reactos/lib/sdk/crt/stdio/file.c
Modified: trunk/reactos/lib/sdk/crt/stdio/file.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/sdk/crt/stdio/file.c?r…
==============================================================================
--- trunk/reactos/lib/sdk/crt/stdio/file.c [iso-8859-1] (original)
+++ trunk/reactos/lib/sdk/crt/stdio/file.c [iso-8859-1] Fri Dec 19 10:57:48 2008
@@ -2167,28 +2167,10 @@
*/
wint_t CDECL fputwc(wint_t wc, FILE* file)
{
- if (file->_flag & _IOBINARY)
- {
- if (fwrite(&wc, sizeof(wc), 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;
+ wchar_t mwc=wc;
+ if (fwrite( &mwc, sizeof(mwc), 1, file) != 1)
+ return WEOF;
+ return wc;
}
/*********************************************************************