]> sourceware.org Git - lvm2.git/commitdiff
[REGEX] Parse regexes that contain chars with value > 0x80
authorJoe Thornber <joe@fib011235813.fsnet.co.uk>
Mon, 9 Aug 2010 10:29:42 +0000 (10:29 +0000)
committerJoe Thornber <joe@fib011235813.fsnet.co.uk>
Mon, 9 Aug 2010 10:29:42 +0000 (10:29 +0000)
This is a long standing issue.  Fixed by casting a char value to
unsigned char before using it as an index into a bitset.

libdm/regex/parse_rx.c

index 56260f54e224c2d8cfe1ad67e14aecac0390c8a1..9f3e1647b97ea74aa7e8a3b79d0f54ac47e38b90 100644 (file)
@@ -271,7 +271,7 @@ static int _rx_get_token(struct parse_sp *ps)
                ps->type = 0;
                ps->cursor = ptr + 1;
                dm_bit_clear_all(ps->charset);
-               dm_bit_set(ps->charset, (int) *ptr);
+               dm_bit_set(ps->charset, (int) (unsigned char) *ptr);
                break;
        }
 
This page took 0.039108 seconds and 5 git commands to generate.