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 74b02ce..1532c05 100644 --- a/generic/tclParse.c +++ b/generic/tclParse.c @@ -844,7 +844,7 @@ TclParseBackslash( Tcl_UniChar unichar = 0; int result; int count; - char buf[TCL_UTF_MAX]; + char buf[TCL_UTF_MAX] = ""; if (numBytes == 0) { if (readPtr != NULL) { @@ -993,8 +993,8 @@ TclParseBackslash( } count = Tcl_UniCharToUtf(result, dst); #if TCL_UTF_MAX > 3 - if (!count) { - count = Tcl_UniCharToUtf(-1, dst); + if ((result >= 0xD800) && (count < 3)) { + count += Tcl_UniCharToUtf(-1, dst + count); } #endif return count; @@ -2217,7 +2217,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: |
