auxdisplay: charlcd: fix hex literal ranges for graphics command
authorRobert Abel <rabel@robertabel.eu>
Fri, 9 Feb 2018 23:50:10 +0000 (00:50 +0100)
committerMiguel Ojeda <miguel.ojeda.sandonis@gmail.com>
Thu, 12 Apr 2018 17:02:44 +0000 (19:02 +0200)
The graphics command expects 16 hexadecimal literals, but would allow
characters in range [0-9a-zA-Z] instead of [0-9a-fA-F].

Signed-off-by: Robert Abel <rabel@robertabel.eu>
Acked-by: Willy Tarreau <w@1wt.eu>
Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
drivers/auxdisplay/charlcd.c

index 0246ff77e7729fccdfff969ebac0e8247538cd47..674ffbae1c656f24def9a222e7ea77735367bd70 100644 (file)
@@ -443,9 +443,9 @@ static inline int handle_lcd_special_code(struct charlcd *lcd)
                        shift ^= 4;
                        if (*esc >= '0' && *esc <= '9') {
                                value |= (*esc - '0') << shift;
-                       } else if (*esc >= 'A' && *esc <= 'Z') {
+                       } else if (*esc >= 'A' && *esc <= 'F') {
                                value |= (*esc - 'A' + 10) << shift;
-                       } else if (*esc >= 'a' && *esc <= 'z') {
+                       } else if (*esc >= 'a' && *esc <= 'f') {
                                value |= (*esc - 'a' + 10) << shift;
                        } else {
                                esc++;