diff options
Diffstat (limited to 'generic/tclParse.c')
-rw-r--r-- | generic/tclParse.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/generic/tclParse.c b/generic/tclParse.c index 9d20fba..61b87a4 100644 --- a/generic/tclParse.c +++ b/generic/tclParse.c @@ -792,7 +792,7 @@ TclParseBackslash( Tcl_UniChar unichar = 0; int result; size_t count; - char buf[TCL_UTF_MAX]; + char buf[TCL_UTF_MAX] = ""; if (numBytes == 0) { if (readPtr != NULL) { @@ -940,9 +940,9 @@ TclParseBackslash( *readPtr = count; } count = Tcl_UniCharToUtf(result, dst); - if (!count) { + if ((result >= 0xD800) && (count < 3)) { /* Special case for handling high surrogates. */ - count = Tcl_UniCharToUtf(-1, dst); + count += Tcl_UniCharToUtf(-1, dst + count); } return count; } @@ -2153,7 +2153,7 @@ TclSubstTokens( Tcl_Obj *appendObj = NULL; const char *append = NULL; int appendByteLength = 0; - char utfCharBytes[TCL_UTF_MAX]; + char utfCharBytes[TCL_UTF_MAX] = ""; switch (tokenPtr->type) { case TCL_TOKEN_TEXT: |