Commit 39345a1b authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

msvcrt: Fixed _ungetwc implementation.

parent 82dd7390
......@@ -3995,9 +3995,12 @@ int CDECL MSVCRT_ungetc(int c, MSVCRT_FILE * file)
MSVCRT_wint_t CDECL MSVCRT_ungetwc(MSVCRT_wint_t wc, MSVCRT_FILE * file)
{
MSVCRT_wchar_t mwc = wc;
char * pp = (char *)&mwc;
unsigned char * pp = (unsigned char *)&mwc;
int i;
if (wc == MSVCRT_WEOF)
return MSVCRT_WEOF;
MSVCRT__lock_file(file);
for(i=sizeof(MSVCRT_wchar_t)-1;i>=0;i--) {
if(pp[i] != MSVCRT_ungetc(pp[i],file)) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment