mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-16 04:06:46 +00:00
- return EOF when stream is empty
- conformance test updated
This commit is contained in:
parent
73802eb354
commit
653510348a
|
@ -90,6 +90,8 @@ int _FUNCTION_ {
|
||||||
#endif /* CONSOLE */
|
#endif /* CONSOLE */
|
||||||
#endif /* WIDE_SCANF */
|
#endif /* WIDE_SCANF */
|
||||||
nch = _GETC_(file);
|
nch = _GETC_(file);
|
||||||
|
if (nch == _EOF_) return _EOF_;
|
||||||
|
|
||||||
va_start(ap, format);
|
va_start(ap, format);
|
||||||
while (*format) {
|
while (*format) {
|
||||||
/* a whitespace character in the format string causes scanf to read,
|
/* a whitespace character in the format string causes scanf to read,
|
||||||
|
|
|
@ -26,8 +26,14 @@ static void test_sscanf( void )
|
||||||
{
|
{
|
||||||
char buffer[100];
|
char buffer[100];
|
||||||
char format[20];
|
char format[20];
|
||||||
int result;
|
int result, ret;
|
||||||
|
|
||||||
|
/* check EOF */
|
||||||
|
strcpy(buffer,"");
|
||||||
|
ret = sscanf(buffer, "%d", &result);
|
||||||
|
ok( ret == EOF,"sscanf returns %x instead of %x", ret, EOF );
|
||||||
|
|
||||||
|
/* check %x */
|
||||||
strcpy(buffer,"0x519");
|
strcpy(buffer,"0x519");
|
||||||
ok( sscanf(buffer, "%x", &result) == 1, "sscanf failed" );
|
ok( sscanf(buffer, "%x", &result) == 1, "sscanf failed" );
|
||||||
ok( result == 0x519,"sscanf reads %x instead of %x", result, 0x519 );
|
ok( result == 0x519,"sscanf reads %x instead of %x", result, 0x519 );
|
||||||
|
|
Loading…
Reference in a new issue