Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date: Thu, 7 Aug 2014 17:55:56 +0800
From: 林冠儒 <>
Subject: fscanf question

I use libc-testsuite and test for fscanf function.
I found that the result is different from glibc.
In this case:
     i = x = y = -1;
     i = fscanf( "tmp.txt", "%5i%2i" , &x, &y)
     printf(" i = %d, x = %d, y = %d" , i , x , y);

tmp.txt content >> "0x12 0x34"

In glibc, it will print >> "i = 2 , x = 18, y = 0"
In musl-libc will print >> "i = 1 , x = 18 , y = -1"

In this case, y's value should be "0x"
I wonder that "0x" is equal to "0" and should be counted as matched string
or not?

It would be very helpful if you email me back and tell me what's the problem
Sorry with my poor english!

Content of type "text/html" skipped

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.