diff options
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tkObj.c | 6 |
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; |