summaryrefslogtreecommitdiffstats
path: root/generic/tclEncoding.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2022-02-24 22:13:52 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2022-02-24 22:13:52 (GMT)
commit671915641bb91ac0aed5250cf92efbfc30f9e0a4 (patch)
tree4c275c29e2738efd1379fafea7e914661764c802 /generic/tclEncoding.c
parentcc70416b7c67eeb1dd8848f44f58fb665899951e (diff)
downloadtcl-671915641bb91ac0aed5250cf92efbfc30f9e0a4.zip
tcl-671915641bb91ac0aed5250cf92efbfc30f9e0a4.tar.gz
tcl-671915641bb91ac0aed5250cf92efbfc30f9e0a4.tar.bz2
Consistancy in TCL_UTF_MAX check
Diffstat (limited to 'generic/tclEncoding.c')
-rw-r--r--generic/tclEncoding.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/generic/tclEncoding.c b/generic/tclEncoding.c
index fd83855..4630a02 100644
--- a/generic/tclEncoding.c
+++ b/generic/tclEncoding.c
@@ -2798,7 +2798,7 @@ UtfToUcs2Proc(
{
const char *srcStart, *srcEnd, *srcClose, *dstStart, *dstEnd;
int result, numChars;
-#if TCL_UTF_MAX <= 3
+#if TCL_UTF_MAX < 4
int len;
#endif
Tcl_UniChar ch = 0;
@@ -2829,7 +2829,7 @@ UtfToUcs2Proc(
result = TCL_CONVERT_NOSPACE;
break;
}
-#if TCL_UTF_MAX <= 3
+#if TCL_UTF_MAX < 4
src += (len = TclUtfToUniChar(src, &ch));
if ((ch >= 0xD800) && (len < 3)) {
src += TclUtfToUniChar(src, &ch);
@@ -3242,7 +3242,7 @@ Iso88591FromUtfProc(
*/
if (ch > 0xFF
-#if TCL_UTF_MAX <= 3
+#if TCL_UTF_MAX < 4
|| ((ch >= 0xD800) && (len < 3))
#endif
) {
@@ -3250,7 +3250,7 @@ Iso88591FromUtfProc(
result = TCL_CONVERT_UNKNOWN;
break;
}
-#if TCL_UTF_MAX <= 3
+#if TCL_UTF_MAX < 4
if ((ch >= 0xD800) && (len < 3)) {
len = 4;
}