summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--generic/tclInt.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/generic/tclInt.h b/generic/tclInt.h
index 2e88348..c536aee 100644
--- a/generic/tclInt.h
+++ b/generic/tclInt.h
@@ -4851,7 +4851,7 @@ MODULE_SCOPE Tcl_PackageInitProc Procbodytest_SafeInit;
(objPtr) = Tcl_NewWideIntObj(w)
#define TclNewIndexObj(objPtr, w) \
- (objPtr) = Tcl_NewWideIntObj((Tcl_WideInt)((w) + 1) - 1)
+ (objPtr) = (w == TCL_INDEX_NONE) ? Tcl_NewWideIntObj(-1) : Tcl_NewWideIntObj(w)
#define TclNewDoubleObj(objPtr, d) \
(objPtr) = Tcl_NewDoubleObj(d)