Proper upper limit for mousechar start is UCHAR_MAX - 3, not UCHAR_MAX
PR: 24437 Submitted by: Cejka Rudolf <cejkar@dcse.fee.vutbr.cz>
This commit is contained in:
parent
ad6931f954
commit
e4ef2fa234
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=75788
@ -488,8 +488,8 @@ set_mouse_char(char *arg)
|
||||
long l;
|
||||
|
||||
l = strtol(arg, NULL, 0);
|
||||
if ((l < 0) || (l > UCHAR_MAX)) {
|
||||
warnx("argument to -M must be 0 through %d", UCHAR_MAX);
|
||||
if ((l < 0) || (l > UCHAR_MAX - 3)) {
|
||||
warnx("argument to -M must be 0 through %d", UCHAR_MAX - 3);
|
||||
return;
|
||||
}
|
||||
mouse.operation = MOUSE_MOUSECHAR;
|
||||
|
Loading…
Reference in New Issue
Block a user