[Bug 1878] New: scanf with %i doesn't work

Wine Bugs wine-bugs at winehq.com
Thu Dec 11 06:38:10 CST 2003


http://bugs.winehq.com/show_bug.cgi?id=1878

           Summary: scanf with %i doesn't work
           Product: Wine
           Version: 20030813
          Platform: PC
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: major
          Priority: P2
         Component: wine-binary
        AssignedTo: wine-bugs at winehq.com
        ReportedBy: wine at alphawave.net


scanfing with %i produces incorrect values and gives a return code of 0, the
following simple example show clearly illustrates the problem and shows that %d
is OK.

int main(int argc, char *argv[])
{
    int i, n;
    argc--;
    argv++;
    if (argc == 0) return 0;
    n = sscanf(argv[0], "%i", &i);
    printf("%%i %s = %i %i\n", argv[0], i, n);

    n = sscanf(argv[0], "%d", &i);
    printf("%%d %s = %i %i\n", argv[0], i, n);
    return 0;
}

compiled with gcc/mingw

$ gcc -dumpversion
3.2.1
$ gcc -dumpmachine
i586-mingw32msvc

$ wine ./test.exe 123
%i 123 = 1074824480 0
%d 123 = 123 1
Wine exited with a successful status

This test program works fine on a Windows PC

-- 
Configure bugmail: http://bugs.winehq.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the wine-bugs mailing list