Commit 545a3b71 authored by Uwe Bonnes's avatar Uwe Bonnes Committed by Alexandre Julliard

Patch and test for scanf %i.

parent 73593d7e
......@@ -168,7 +168,7 @@ int _FUNCTION_ {
base = 10; number_signed = 1;
goto number;
case 'i': /* generic integer */
base = 0; number_signed = 1;
base = 10; number_signed = 1;
number: {
/* read an integer */
long unsigned int cur = 0;
......
......@@ -73,6 +73,15 @@ static void test_sscanf( void )
ret = sscanf(buffer+2,"%*c%n",&number_so_far);
ok(ret == 0 , "problem with format arg \"%%*c%%n\"");
ok(number_so_far == 1,"Read wrong arg for \"%%n\" %d instead of 2",number_so_far);
/* Check %i according to bug 1878 */
strcpy(buffer,"123");
ret = sscanf(buffer, "%i", &result);
ok( ret == 1 , "Wrong number of arguments read");
ok(result == 123, "Wrong number read");
ret = sscanf(buffer, "%d", &result);
ok( ret == 1 , "Wrong number of arguments read");
ok(result == 123, "Wrong number read");
}
static void test_sprintf( void )
......
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