msvcrt: Fixed _ungetwc implementation.
This commit is contained in:
parent
82dd739064
commit
39345a1b15
|
@ -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)) {
|
||||
|
|
Loading…
Reference in New Issue