summaryrefslogtreecommitdiffstats
path: root/generic/tkMenu.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2021-02-03 08:51:51 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2021-02-03 08:51:51 (GMT)
commit5eb6f18dd83f41569f38f47701775e57e9699481 (patch)
tree205fdab202fa27a1a465cc99c70dfbbf10e0e46a /generic/tkMenu.c
parentda4a9e05802dc6decc27f9440eb9b4570ca716c6 (diff)
parent06420ba2fed328cf5559b51d715c8554ff00c69c (diff)
downloadtk-5eb6f18dd83f41569f38f47701775e57e9699481.zip
tk-5eb6f18dd83f41569f38f47701775e57e9699481.tar.gz
tk-5eb6f18dd83f41569f38f47701775e57e9699481.tar.bz2
Merge 8.7
Diffstat (limited to 'generic/tkMenu.c')
-rw-r--r--generic/tkMenu.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/generic/tkMenu.c b/generic/tkMenu.c
index 72a96c6..2fa5e79 100644
--- a/generic/tkMenu.c
+++ b/generic/tkMenu.c
@@ -2130,7 +2130,7 @@ GetMenuIndex(
if (TkGetIntForIndex(objPtr, menuPtr->numEntries - 1, lastOK, indexPtr) == TCL_OK) {
/* TCL_INDEX_NONE is only accepted if it does not result from a negative number */
if (*indexPtr != TCL_INDEX_NONE || Tcl_GetString(objPtr)[0] != '-') {
- if (*indexPtr >= menuPtr->numEntries) {
+ if (*indexPtr + 1 >= menuPtr->numEntries + 1) {
*indexPtr = menuPtr->numEntries - ((lastOK) ? 0 : 1);
}
return TCL_OK;