summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--generic/tclUtf.c2
-rw-r--r--tests/utf.test6
2 files changed, 4 insertions, 4 deletions
diff --git a/generic/tclUtf.c b/generic/tclUtf.c
index fdf2e32..e637263 100644
--- a/generic/tclUtf.c
+++ b/generic/tclUtf.c
@@ -154,7 +154,7 @@ UtfCount(
static CONST unsigned char overlong[3] = {
0x80, /* \xD0 -- all sequences valid */
0xA0, /* \xE0\x80 through \xE0\x9F are invalid prefixes */
-#if TCL_UTF_MAX > 3
+#if TCL_UTF_MAX >= 3
0x90 /* \xF0\x80 through \xF0\x8F are invalid prefixes */
#else
0xC0 /* Not used, but reject all again for safety. */
diff --git a/tests/utf.test b/tests/utf.test
index 2004625..e8b1d51 100644
--- a/tests/utf.test
+++ b/tests/utf.test
@@ -630,13 +630,13 @@ test utf-7.38 {Tcl_UtfPrev -- overlong sequence} testutfprev {
} 1
test utf-7.39 {Tcl_UtfPrev -- overlong sequence} {testutfprev} { # Doesn't work with TCL_UTF_MAX>3
testutfprev A\xF0\x90\x80\x80
-} 4
+} 1
test utf-7.40 {Tcl_UtfPrev -- overlong sequence} {testutfprev} { # Doesn't work with TCL_UTF_MAX>3
testutfprev A\xF0\x90\x80\x80 4
-} 3
+} 1
test utf-7.41 {Tcl_UtfPrev -- overlong sequence} {testutfprev} { # Doesn't work with TCL_UTF_MAX>3
testutfprev A\xF0\x90\x80\x80 3
-} 2
+} 1
test utf-7.42 {Tcl_UtfPrev -- overlong sequence} testutfprev {
testutfprev A\xF0\x90\x80\x80 2
} 1