diff options
author | dgp <dgp@users.sourceforge.net> | 2018-04-05 15:37:40 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2018-04-05 15:37:40 (GMT) |
commit | eb8817687f0753816e8308b93b3e992414afeca4 (patch) | |
tree | 372853cc650d958a2bca125e652a970ceb0ea82b /generic | |
parent | 0ad3b13e2663019e4ff8d3dc944fd030e33eb358 (diff) | |
download | tcl-eb8817687f0753816e8308b93b3e992414afeca4.zip tcl-eb8817687f0753816e8308b93b3e992414afeca4.tar.gz tcl-eb8817687f0753816e8308b93b3e992414afeca4.tar.bz2 |
[string cat] was failing to NUL terminate string reps.
Stopped "string" values triggering false valgrind alarms when tests make
use of [tcl::unsupported::representation].
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tclStringObj.c | 2 | ||||
-rw-r--r-- | generic/tclStringRep.h | 1 |
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)) /* |