diff options
Diffstat (limited to 'generic/tclScan.c')
-rw-r--r-- | generic/tclScan.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/generic/tclScan.c b/generic/tclScan.c index 45035f1..21ad953 100644 --- a/generic/tclScan.c +++ b/generic/tclScan.c @@ -882,7 +882,7 @@ Tcl_ScanObjCmd( offset = TclUtfToUniChar(string, &sch); i = (int)sch; #if TCL_UTF_MAX == 4 - if ((offset == 1) && ((sch & 0xFC00) == 0xD800)) { + if (((sch & 0xFC00) == 0xD800) && (offset < 3)) { offset += TclUtfToUniChar(string+offset, &sch); i = (((i<<10) & 0x0FFC00) + 0x10000) + (sch & 0x3FF); } |