msvcrt: Fix scanf with dashes in scanset.

Signed-off-by: Will Mainio <will.mainio@fastmail.com>
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Will Mainio 2020-11-02 16:00:07 +01:00 committed by Alexandre Julliard
parent 12bc7c0abe
commit c38102b9b4
1 changed files with 6 additions and 6 deletions

View File

@ -639,12 +639,12 @@ _FUNCTION_ {
while(*format && (*format != ']')) {
/* According to msdn:
* "Note that %[a-z] and %[z-a] are interpreted as equivalent to %[abcde...z]." */
if((*format == '-') && (*(format + 1) != ']')) {
if ((*(format - 1)) < *(format + 1))
RtlSetBits(&bitMask, *(format - 1) +1 , *(format + 1) - *(format - 1));
if(format[1] == '-' && format[2] && format[2] != ']') {
if (format[0] < format[2])
RtlSetBits(&bitMask, format[0], format[2] - format[0] + 1);
else
RtlSetBits(&bitMask, *(format + 1) , *(format - 1) - *(format + 1));
format++;
RtlSetBits(&bitMask, format[2], format[0] - format[2] + 1);
format += 2;
} else
RtlSetBits(&bitMask, *format, 1);
format++;