summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--generic/tclTest.c7
-rw-r--r--generic/tclUtil.c2
2 files changed, 5 insertions, 4 deletions
diff --git a/generic/tclTest.c b/generic/tclTest.c
index 95ef5b7..5e6ca8c 100644
--- a/generic/tclTest.c
+++ b/generic/tclTest.c
@@ -7046,20 +7046,21 @@ TestGetIntForIndexCmd(
int objc,
Tcl_Obj *const objv[])
{
- int result, endvalue;
+ int result;
+ Tcl_WideInt endvalue;
if (objc != 3) {
Tcl_WrongNumArgs(interp, 1, objv, "index endvalue");
return TCL_ERROR;
}
- if (Tcl_GetIntFromObj(interp, objv[2], &endvalue) != TCL_OK) {
+ if (Tcl_GetWideIntFromObj(interp, objv[2], &endvalue) != TCL_OK) {
return TCL_ERROR;
}
if (Tcl_GetIntForIndex(interp, objv[1], endvalue, &result) != TCL_OK) {
return TCL_ERROR;
}
- Tcl_SetObjResult(interp, Tcl_NewIntObj(result));
+ Tcl_SetObjResult(interp, Tcl_NewWideIntObj(result));
return TCL_OK;
}
diff --git a/generic/tclUtil.c b/generic/tclUtil.c
index 10153fb..e29afcc 100644
--- a/generic/tclUtil.c
+++ b/generic/tclUtil.c
@@ -3699,7 +3699,7 @@ Tcl_GetIntForIndex(
{
Tcl_WideInt wide;
- if (GetWideForIndex(interp, objPtr, (size_t)(endValue + 1) - 1, &wide) == TCL_ERROR) {
+ if (GetWideForIndex(interp, objPtr, endValue, &wide) == TCL_ERROR) {
return TCL_ERROR;
}
if (indexPtr != NULL) {