summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorstanton <stanton>1999-07-09 02:11:56 (GMT)
committerstanton <stanton>1999-07-09 02:11:56 (GMT)
commit196bfbe531ff0bb8488dde587ee9ffc46a8ffe55 (patch)
tree87cc6cef2a28b7a8e79c5e8fae1e7a4f71f4cffe /generic
parent96da55129351108de4a053ec7b8cdfa272f727ee (diff)
downloadtcl-196bfbe531ff0bb8488dde587ee9ffc46a8ffe55.zip
tcl-196bfbe531ff0bb8488dde587ee9ffc46a8ffe55.tar.gz
tcl-196bfbe531ff0bb8488dde587ee9ffc46a8ffe55.tar.bz2
* tests/string.test:
* generic/tclCmdMZ.c: Fixed bug in string range bounds checking code.
Diffstat (limited to 'generic')
-rw-r--r--generic/tclCmdMZ.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/generic/tclCmdMZ.c b/generic/tclCmdMZ.c
index ab6387d..db92f19 100644
--- a/generic/tclCmdMZ.c
+++ b/generic/tclCmdMZ.c
@@ -13,7 +13,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclCmdMZ.c,v 1.17 1999/07/02 19:59:38 welch Exp $
+ * RCS: @(#) $Id: tclCmdMZ.c,v 1.18 1999/07/09 02:11:56 stanton Exp $
*/
#include "tclInt.h"
@@ -1648,8 +1648,8 @@ Tcl_StringObjCmd(dummy, interp, objc, objv)
if (first < 0) {
first = 0;
}
- if (last >= length1 - 1) {
- last = length1 - 1;
+ if (last >= length2) {
+ last = length2;
}
if (last >= first) {
resultPtr = Tcl_GetRange(objv[2], first, last);