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:
ache 2001-04-21 13:50:32 +00:00
parent 54263d2af4
commit 60fe15c90d

View File

@ -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;