- 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 /* 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,
|
||||
|
|
|
@ -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 );
|
||||
|
|
Loading…
Reference in New Issue