summaryrefslogtreecommitdiffstats
path: root/generic/tclUtil.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2018-10-23 19:01:55 (GMT)
committerdgp <dgp@users.sourceforge.net>2018-10-23 19:01:55 (GMT)
commit9db751daebe489baa4dd45c402a87af1428b439c (patch)
tree11cfa63f00dc2afa763d4bdc44b4e3874a6c3177 /generic/tclUtil.c
parenta883ddbe3e214ba2ffa048e61a6f4641519c460b (diff)
downloadtcl-9db751daebe489baa4dd45c402a87af1428b439c.zip
tcl-9db751daebe489baa4dd45c402a87af1428b439c.tar.gz
tcl-9db751daebe489baa4dd45c402a87af1428b439c.tar.bz2
End the deprecated practice of accepting "e" and "en" as valid index values.
Diffstat (limited to 'generic/tclUtil.c')
-rw-r--r--generic/tclUtil.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/generic/tclUtil.c b/generic/tclUtil.c
index 954caff..7996703 100644
--- a/generic/tclUtil.c
+++ b/generic/tclUtil.c
@@ -3935,12 +3935,14 @@ GetEndOffsetFromObj(
int length;
const char *bytes = TclGetStringFromObj(objPtr, &length);
- if ((*bytes != 'e') || (strncmp(bytes, "end",
- (size_t)((length > 3) ? 3 : length)) != 0)) {
+ if ((length < 3) || (length == 4)) {
+ return TCL_ERROR;
+ }
+ if ((*bytes != 'e') || (strncmp(bytes, "end", 3) != 0)) {
return TCL_ERROR;
}
- if (length <= 3) {
+ if (length == 3) {
offset = 0;
} else if ((length > 4) && ((bytes[3] == '-') || (bytes[3] == '+'))) {
/*