Skip to content

Commit 2e8c04f

Browse files
Tauwasserojeda
authored andcommitted
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 <[email protected]> Acked-by: Willy Tarreau <[email protected]> Reviewed-by: Geert Uytterhoeven <[email protected]> Signed-off-by: Miguel Ojeda <[email protected]>
1 parent 99b9b49 commit 2e8c04f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/auxdisplay/charlcd.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -443,9 +443,9 @@ static inline int handle_lcd_special_code(struct charlcd *lcd)
443443
shift ^= 4;
444444
if (*esc >= '0' && *esc <= '9') {
445445
value |= (*esc - '0') << shift;
446-
} else if (*esc >= 'A' && *esc <= 'Z') {
446+
} else if (*esc >= 'A' && *esc <= 'F') {
447447
value |= (*esc - 'A' + 10) << shift;
448-
} else if (*esc >= 'a' && *esc <= 'z') {
448+
} else if (*esc >= 'a' && *esc <= 'f') {
449449
value |= (*esc - 'a' + 10) << shift;
450450
} else {
451451
esc++;

0 commit comments

Comments
 (0)