mirror of
https://github.com/reactos/wine.git
synced 2024-11-25 04:39:45 +00:00
msvcrt: Make WEOF returned from swscanf signed.
This commit is contained in:
parent
739bd884a0
commit
5a3695ccee
@ -26,7 +26,7 @@
|
||||
#ifdef WIDE_SCANF
|
||||
#define _CHAR_ MSVCRT_wchar_t
|
||||
#define _EOF_ MSVCRT_WEOF
|
||||
#define _EOF_RET MSVCRT_WEOF
|
||||
#define _EOF_RET (short)MSVCRT_WEOF
|
||||
#define _ISSPACE_(c) MSVCRT_iswspace(c)
|
||||
#define _ISDIGIT_(c) MSVCRT_iswdigit(c)
|
||||
#define _WIDE2SUPPORTED_(c) c /* No conversion needed (wide to wide) */
|
||||
|
@ -243,8 +243,25 @@ static void test_sscanf_s(void)
|
||||
ok(i==123, "i = %d\n", i);
|
||||
}
|
||||
|
||||
static void test_swscanf( void )
|
||||
{
|
||||
wchar_t buffer[100];
|
||||
int result, ret;
|
||||
static const WCHAR formatd[] = {'%','d',0};
|
||||
|
||||
/* check WEOF */
|
||||
/* WEOF is an unsigned short -1 but swscanf returns int
|
||||
so it should be sign-extended */
|
||||
buffer[0] = 0;
|
||||
ret = swscanf(buffer, formatd, &result);
|
||||
/* msvcrt returns 0 but should return -1 (later versions do) */
|
||||
ok( ret == (short)WEOF || broken(ret == 0),
|
||||
"swscanf returns %x instead of %x\n", ret, WEOF );
|
||||
}
|
||||
|
||||
START_TEST(scanf)
|
||||
{
|
||||
test_sscanf();
|
||||
test_sscanf_s();
|
||||
test_swscanf();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user