diff options
author | Robert Abel <rabel@robertabel.eu> | 2018-02-09 18:50:10 -0500 |
---|---|---|
committer | Miguel Ojeda <miguel.ojeda.sandonis@gmail.com> | 2018-04-12 13:02:44 -0400 |
commit | 2e8c04f75731bbd968fa77e94ed856f2dcf53ae6 (patch) | |
tree | 5e9f186448e00459b39e4068a1022132c070ea84 /drivers/auxdisplay | |
parent | 99b9b4909c72e06b46e2fdf083c96b585cb84adb (diff) |
auxdisplay: charlcd: fix hex literal ranges for graphics command
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>
Diffstat (limited to 'drivers/auxdisplay')
-rw-r--r-- | drivers/auxdisplay/charlcd.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/auxdisplay/charlcd.c b/drivers/auxdisplay/charlcd.c index 0246ff77e772..674ffbae1c65 100644 --- a/drivers/auxdisplay/charlcd.c +++ b/drivers/auxdisplay/charlcd.c | |||
@@ -443,9 +443,9 @@ static inline int handle_lcd_special_code(struct charlcd *lcd) | |||
443 | shift ^= 4; | 443 | shift ^= 4; |
444 | if (*esc >= '0' && *esc <= '9') { | 444 | if (*esc >= '0' && *esc <= '9') { |
445 | value |= (*esc - '0') << shift; | 445 | value |= (*esc - '0') << shift; |
446 | } else if (*esc >= 'A' && *esc <= 'Z') { | 446 | } else if (*esc >= 'A' && *esc <= 'F') { |
447 | value |= (*esc - 'A' + 10) << shift; | 447 | value |= (*esc - 'A' + 10) << shift; |
448 | } else if (*esc >= 'a' && *esc <= 'z') { | 448 | } else if (*esc >= 'a' && *esc <= 'f') { |
449 | value |= (*esc - 'a' + 10) << shift; | 449 | value |= (*esc - 'a' + 10) << shift; |
450 | } else { | 450 | } else { |
451 | esc++; | 451 | esc++; |