summaryrefslogtreecommitdiffstats
path: root/generic/tkObj.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tkObj.c')
-rw-r--r--generic/tkObj.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/generic/tkObj.c b/generic/tkObj.c
index bbd331c..cfcb770 100644
--- a/generic/tkObj.c
+++ b/generic/tkObj.c
@@ -238,11 +238,11 @@ TkGetIntForIndex(Tcl_Obj *indexObj, TkSizeT end, TkSizeT *indexPtr) {
return TCL_ERROR;
}
#if TCL_MAJOR_VERSION < 9
- if (*indexPtr < -1) {
- *indexPtr = TCL_INDEX_NONE;
+ if ((*indexPtr < -1) || (end < -1)) {
+ return TCL_ERROR;
}
#endif
- if ((*indexPtr != TCL_INDEX_NONE) && (*indexPtr > end)) {
+ if ((*indexPtr + 1) > (end + 1)) {
*indexPtr = end + 1;
}
return TCL_OK;