summaryrefslogtreecommitdiffstats
path: root/generic/tclCmdIL.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tclCmdIL.c')
-rw-r--r--generic/tclCmdIL.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/generic/tclCmdIL.c b/generic/tclCmdIL.c
index aff66e2..49d9b77 100644
--- a/generic/tclCmdIL.c
+++ b/generic/tclCmdIL.c
@@ -14,7 +14,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclCmdIL.c,v 1.15 1999/08/10 17:35:18 redman Exp $
+ * RCS: @(#) $Id: tclCmdIL.c,v 1.16 1999/09/21 04:20:40 hobbs Exp $
*/
#include "tclInt.h"
@@ -1954,8 +1954,12 @@ Tcl_LinsertObjCmd(dummy, interp, objc, objv)
* will invalidate the list's internal representation.
*/
- result = TclGetIntForIndex(interp, objv[2], /*endValue*/ INT_MAX,
- &index);
+ result = Tcl_ListObjLength(interp, objv[1], &len);
+ if (result != TCL_OK) {
+ return result;
+ }
+
+ result = TclGetIntForIndex(interp, objv[2], /*endValue*/ len, &index);
if (result != TCL_OK) {
return result;
}