diff options
Diffstat (limited to 'generic/tclStringObj.c')
| -rw-r--r-- | generic/tclStringObj.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/generic/tclStringObj.c b/generic/tclStringObj.c index 9913160..fa50d6d 100644 --- a/generic/tclStringObj.c +++ b/generic/tclStringObj.c @@ -1972,6 +1972,7 @@ Tcl_AppendFormatToObj( if (cmpResult == MP_EQ) gotHash = 0; if (ch == 'u') { if (isNegative) { + mp_clear(&big); msg = "unsigned bignum format is invalid"; errCode = "BADUNSIGNED"; goto errorMsg; @@ -3205,6 +3206,8 @@ TclStringCat( dst += more; } } + /* Must NUL-terminate! */ + *dst = '\0'; } return objResultPtr; @@ -3637,6 +3640,7 @@ TclStringReplace( } result = Tcl_NewByteArrayObj(NULL, numBytes - count + newBytes); /* PANIC? */ + Tcl_SetByteArrayLength(result, 0); TclAppendBytesToByteArray(result, bytes, first); TclAppendBytesToByteArray(result, iBytes, newBytes); TclAppendBytesToByteArray(result, bytes + first + count, |
