Description of problem: 'sscanf' does not process hex (0x) values properly if the MSB (sign) bit is set using "%i" conversion. I suspect that the conversion routines do not parse the value as a hex bit pattern, but convert the value to decimal thus causing an overflow condition. This would explain why the cases in question would return the max positive value. Version-Release number of selected component (if applicable): RHEL4 U2 How reproducible: test case attached. Steps to Reproduce: Compile and execute test case Additional info: Using this test case on x86_64 the sscanf works fine.
Created attachment 134817 [details] sscanf test case
Please read the standard: http://www.opengroup.org/onlinepubs/009695399/functions/scanf.html http://www.opengroup.org/onlinepubs/009695399/functions/strtol.html 0XFFFFFF00 is not in range of the int type (INT_MIN .. INT_MAX), so INT_MAX should be returned. If you want a negative number in hexadecimal notation, write -0x100.