diff options
| author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2022-01-24 11:01:07 (GMT) |
|---|---|---|
| committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2022-01-24 11:01:07 (GMT) |
| commit | bc8c2ad47a5fc72622020a829493e50e449bd040 (patch) | |
| tree | 788b0c3fe99eccac4fab9b0d598f466d163e5855 /generic/tclTest.c | |
| parent | 511e85013ac111a96845721348abc019321ab15e (diff) | |
| download | tcl-bc8c2ad47a5fc72622020a829493e50e449bd040.zip tcl-bc8c2ad47a5fc72622020a829493e50e449bd040.tar.gz tcl-bc8c2ad47a5fc72622020a829493e50e449bd040.tar.bz2 | |
Fix another bug in Tcl_GetIntForIndex() (demonstrated by the new testcases from the previous commit)
Diffstat (limited to 'generic/tclTest.c')
| -rw-r--r-- | generic/tclTest.c | 7 |
1 files changed, 4 insertions, 3 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; } |
