[Bug 59409] New: msvcrt: scanf scanset character ranges with high bytes (\x80-\xff) broken due to signed char comparison in scanf.h
http://bugs.winehq.org/show_bug.cgi?id=59409 Bug ID: 59409 Summary: msvcrt: scanf scanset character ranges with high bytes (\x80-\xff) broken due to signed char comparison in scanf.h Product: Wine Version: 11.2 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: msvcrt Assignee: wine-bugs@list.winehq.org Reporter: marco.bartoli.dev@gmail.com Distribution: --- Created attachment 80377 --> http://bugs.winehq.org/attachment.cgi?id=80377 repro The %[a-z]-style scanset range handling in scanf.h uses a signed comparison of format string characters, causing all ranges that include bytes above \x7f (e.g., %1[\x01-\xff]) to fail to match anything. This differs from native MSVCRT behavior and from other C libraries (glibc, etc) which handle this correctly. Affected code in dlls/msvcrt/scanf.h: ```c if (format[0] < format[2]) RtlSetBits(&bitMask, format[0], format[2] - format[0] + 1); else RtlSetBits(&bitMask, format[2], format[0] - format[2] + 1); ``` On x86/x64 chars are defined as signed so the comparison and subtractions needs to be handles with casting to unsigned char. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=59409 Eric Pouech <eric.pouech@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |eric.pouech@gmail.com --- Comment #1 from Eric Pouech <eric.pouech@gmail.com> --- should be fixed by 5f241ebda259ae2a7f0aaa39b6d8df2f5bc60044 -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
participants (1)
-
WineHQ Bugzilla