Ensure the result from signed subtraction under modulus does not
become negative. Submitted by: Oliver Pinter <oliver.pinter@hardenedbsd.org> MFC after: 3 days
This commit is contained in:
parent
53d1c63711
commit
b1b7114036
@ -785,7 +785,7 @@ vt_processkey(keyboard_t *kbd, struct vt_device *vd, int c)
|
||||
return (0);
|
||||
case PREV:
|
||||
/* Switch to previous VT. */
|
||||
c = (vw->vw_number - 1) % VT_MAXWINDOWS;
|
||||
c = (vw->vw_number + VT_MAXWINDOWS - 1) % VT_MAXWINDOWS;
|
||||
vw = vd->vd_windows[c];
|
||||
vt_proc_window_switch(vw);
|
||||
return (0);
|
||||
|
Loading…
x
Reference in New Issue
Block a user