Commit 65351034 authored by Mehmet Yasar's avatar Mehmet Yasar Committed by Alexandre Julliard

- return EOF when stream is empty

- conformance test updated
parent 73802eb3
...@@ -90,6 +90,8 @@ int _FUNCTION_ { ...@@ -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 ) ...@@ -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 );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment