summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
Diffstat (limited to 'generic')
-rw-r--r--generic/tclStringObj.c2
-rw-r--r--generic/tclStringRep.h1
2 files changed, 3 insertions, 0 deletions
diff --git a/generic/tclStringObj.c b/generic/tclStringObj.c
index 2ebec64..a2a1d41 100644
--- a/generic/tclStringObj.c
+++ b/generic/tclStringObj.c
@@ -3205,6 +3205,8 @@ TclStringCat(
dst += more;
}
}
+ /* Must NUL-terminate! */
+ *dst = '\0';
}
return objResultPtr;
diff --git a/generic/tclStringRep.h b/generic/tclStringRep.h
index 1ef1957..fc5a713 100644
--- a/generic/tclStringRep.h
+++ b/generic/tclStringRep.h
@@ -86,6 +86,7 @@ typedef struct {
#define GET_STRING(objPtr) \
((String *) (objPtr)->internalRep.twoPtrValue.ptr1)
#define SET_STRING(objPtr, stringPtr) \
+ ((objPtr)->internalRep.twoPtrValue.ptr2 = NULL), \
((objPtr)->internalRep.twoPtrValue.ptr1 = (void *) (stringPtr))
/*