aboutsummaryrefslogtreecommitdiff
path: root/jim.c
diff options
context:
space:
mode:
authorSteve Bennett <steveb@workware.net.au>2020-05-02 16:43:01 +1000
committerSteve Bennett <steveb@workware.net.au>2020-05-04 21:58:38 +1000
commitb58ccf39a730dba009abbbae19cb55e0200d37ac (patch)
treea48eb4289f3b10b4ca53535bb4eec8b9f68b5bc6 /jim.c
parent72c78e31ab153f318e431c81cfc4b9d08701a515 (diff)
downloadjimtcl-b58ccf39a730dba009abbbae19cb55e0200d37ac.zip
jimtcl-b58ccf39a730dba009abbbae19cb55e0200d37ac.tar.gz
jimtcl-b58ccf39a730dba009abbbae19cb55e0200d37ac.tar.bz2
jim.c: Fix UpdateStringOfIndex()
In case the index is invalid, the string should contain -MAX_INT Signed-off-by: Steve Bennett <steveb@workware.net.au>
Diffstat (limited to 'jim.c')
-rw-r--r--jim.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/jim.c b/jim.c
index 3658849..81fe7d2 100644
--- a/jim.c
+++ b/jim.c
@@ -7414,7 +7414,7 @@ static void UpdateStringOfIndex(struct Jim_Obj *objPtr)
}
else {
char buf[JIM_INTEGER_SPACE + 1];
- if (objPtr->internalRep.intValue >= 0) {
+ if (objPtr->internalRep.intValue >= 0 || objPtr->internalRep.intValue == -INT_MAX) {
sprintf(buf, "%d", objPtr->internalRep.intValue);
}
else {