msvcrt: Fix char to int promotion that breaks pattern lookup.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com> Signed-off-by: Piotr Caban <piotr@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
b0d4502c29
commit
d99727bcb3
|
@ -68,7 +68,11 @@
|
|||
#undef _EOF_
|
||||
#define _EOF_ 0
|
||||
#ifdef STRING_LEN
|
||||
#ifdef WIDE_CHAR
|
||||
#define _GETC_(file) (consumed==length ? '\0' : (consumed++, *file++))
|
||||
#else /* WIDE_CHAR */
|
||||
#define _GETC_(file) (consumed==length ? '\0' : (consumed++, (unsigned char)*file++))
|
||||
#endif /* WIDE_CHAR */
|
||||
#define _UNGETC_(nch, file) do { file--; consumed--; } while(0)
|
||||
#define _LOCK_FILE_(file) do {} while(0)
|
||||
#define _UNLOCK_FILE_(file) do {} while(0)
|
||||
|
@ -86,7 +90,11 @@
|
|||
#endif /* SECURE */
|
||||
#endif /* WIDE_SCANF */
|
||||
#else /* STRING_LEN */
|
||||
#ifdef WIDE_CHAR
|
||||
#define _GETC_(file) (consumed++, *file++)
|
||||
#else /* WIDE_CHAR */
|
||||
#define _GETC_(file) (consumed++, (unsigned char)*file++)
|
||||
#endif /* WIDE_CHAR */
|
||||
#define _UNGETC_(nch, file) do { file--; consumed--; } while(0)
|
||||
#define _LOCK_FILE_(file) do {} while(0)
|
||||
#define _UNLOCK_FILE_(file) do {} while(0)
|
||||
|
|
|
@ -244,6 +244,13 @@ static void test_sscanf( void )
|
|||
ret = sscanf(buffer, "%d:%d%n", &hour, &min, &number_so_far);
|
||||
ok(ret == 2, "Wrong number of arguments read: %d\n", ret);
|
||||
ok(number_so_far == 4, "%%n yielded wrong result: %d\n", number_so_far);
|
||||
|
||||
buffer[0] = 0;
|
||||
buffer1[0] = 0;
|
||||
ret = sscanf("test=value\xda", "%[^=] = %[^;]", buffer, buffer1);
|
||||
ok(ret == 2, "got %d\n", ret);
|
||||
ok(!strcmp(buffer, "test"), "buf %s\n", buffer);
|
||||
ok(!strcmp(buffer1, "value\xda"), "buf %s\n", buffer1);
|
||||
}
|
||||
|
||||
static void test_sscanf_s(void)
|
||||
|
|
Loading…
Reference in New Issue