summaryrefslogtreecommitdiffstats
path: root/generic/tclTest.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2020-04-05 20:11:49 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2020-04-05 20:11:49 (GMT)
commit57d80b8062bd84389ce200cf7fd42c52b5466b07 (patch)
tree268a1b663344ad7de4188352a78a212ad9ea61ac /generic/tclTest.c
parent2bc844ee6103b696341a49471260cd58963a0b51 (diff)
downloadtcl-57d80b8062bd84389ce200cf7fd42c52b5466b07.zip
tcl-57d80b8062bd84389ce200cf7fd42c52b5466b07.tar.gz
tcl-57d80b8062bd84389ce200cf7fd42c52b5466b07.tar.bz2
Revert test-case utf-4.10 change from previous commit: It caused the Travis build failure.
Change the testnumutfchars command to accept "end+1" as lenght, in which case it will count the ending null-byte too, as test-case 4.10 demands.
Diffstat (limited to 'generic/tclTest.c')
-rw-r--r--generic/tclTest.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/generic/tclTest.c b/generic/tclTest.c
index f63f891..e187ec2 100644
--- a/generic/tclTest.c
+++ b/generic/tclTest.c
@@ -6809,9 +6809,11 @@ TestNumUtfCharsCmd(
const char *bytes = Tcl_GetStringFromObj(objv[1], &numBytes);
if (objc > 2) {
- (void) Tcl_GetIntFromObj(interp, objv[2], &limit);
- if (limit > numBytes) {
- limit = numBytes;
+ if (TclGetIntForIndex(interp, objv[2], numBytes, &limit) != TCL_OK) {
+ return TCL_ERROR;
+ }
+ if (limit > numBytes + 1) {
+ limit = numBytes + 1;
}
}
len = Tcl_NumUtfChars(bytes, limit);