diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2019-12-09 19:36:21 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2019-12-09 19:36:21 (GMT) |
commit | 216a1d1937f2844d311f703e5a8e0ee41806c7f2 (patch) | |
tree | 9f0f909dcf4e21f2026f9ca9cc2669f214683983 /generic/tclEncoding.c | |
parent | c66173309fa8adc4c4159bdeae016c7f9e2cbae0 (diff) | |
download | tcl-216a1d1937f2844d311f703e5a8e0ee41806c7f2.zip tcl-216a1d1937f2844d311f703e5a8e0ee41806c7f2.tar.gz tcl-216a1d1937f2844d311f703e5a8e0ee41806c7f2.tar.bz2 |
Attempt to fix [5f236bc67a]: valgrind report for Tcl_UniCharToUtf
Diffstat (limited to 'generic/tclEncoding.c')
-rw-r--r-- | generic/tclEncoding.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/generic/tclEncoding.c b/generic/tclEncoding.c index ffa23f3..8990385 100644 --- a/generic/tclEncoding.c +++ b/generic/tclEncoding.c @@ -2365,7 +2365,7 @@ UtfToUtfProc( /* A surrogate character is detected, handle especially */ Tcl_UniChar low = *chPtr; size_t len = (src <= srcEnd-3) ? Tcl_UtfToUniChar(src, &low) : 0; - if (((low | 0x3FF) != 0xDFFF) || !(*chPtr & 0x800)) { + if (((low | 0x3FF) != 0xDFFF) || (*chPtr & 0x400)) { *dst++ = (char) (((*chPtr >> 12) | 0xE0) & 0xEF); *dst++ = (char) (((*chPtr >> 6) | 0x80) & 0xBF); *dst++ = (char) ((*chPtr | 0x80) & 0xBF); |