mirror of
https://github.com/torvalds/linux.git
synced 2024-11-25 21:51:40 +00:00
tty: vt: use switch+case in the ESgetpars case
To be uniform in the 'c' handling, use switch-case (with ranges) even in the ESgetpars case in do_con_trol(). Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org> Link: https://lore.kernel.org/r/20240202065608.14019-21-jirislaby@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
3d5f5b9711
commit
137eb9ad22
@ -2628,10 +2628,14 @@ static void do_con_trol(struct tty_struct *tty, struct vc_data *vc, u8 c)
|
||||
vc->vc_priv = EPecma;
|
||||
fallthrough;
|
||||
case ESgetpars: /* ESC [ aka CSI, parameters expected */
|
||||
if (c == ';' && vc->vc_npar < NPAR - 1) {
|
||||
vc->vc_npar++;
|
||||
return;
|
||||
} else if (c>='0' && c<='9') {
|
||||
switch (c) {
|
||||
case ';':
|
||||
if (vc->vc_npar < NPAR - 1) {
|
||||
vc->vc_npar++;
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case '0' ... '9':
|
||||
vc->vc_par[vc->vc_npar] *= 10;
|
||||
vc->vc_par[vc->vc_npar] += c - '0';
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user