- return EOF when stream is empty

- conformance test updated
This commit is contained in:
Mehmet Yasar 2003-01-11 20:53:22 +00:00 committed by Alexandre Julliard
parent 73802eb354
commit 653510348a
2 changed files with 9 additions and 1 deletions

View file

@ -90,6 +90,8 @@ int _FUNCTION_ {
#endif /* CONSOLE */
#endif /* WIDE_SCANF */
nch = _GETC_(file);
if (nch == _EOF_) return _EOF_;
va_start(ap, format);
while (*format) {
/* a whitespace character in the format string causes scanf to read,

View file

@ -26,8 +26,14 @@ static void test_sscanf( void )
{
char buffer[100];
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");
ok( sscanf(buffer, "%x", &result) == 1, "sscanf failed" );
ok( result == 0x519,"sscanf reads %x instead of %x", result, 0x519 );