summaryrefslogtreecommitdiffstats
path: root/generic/tclStringObj.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2009-04-10 21:27:17 (GMT)
committerdgp <dgp@users.sourceforge.net>2009-04-10 21:27:17 (GMT)
commit3e6525f2b14416df0ccfb4201c048153c6b23301 (patch)
tree0db8e2ef5a7b5c423ad50fd0d0add26111e0fd82 /generic/tclStringObj.c
parent4c2b245e27fabb65ca587fbc21d76208c7c57709 (diff)
downloadtcl-3e6525f2b14416df0ccfb4201c048153c6b23301.zip
tcl-3e6525f2b14416df0ccfb4201c048153c6b23301.tar.gz
tcl-3e6525f2b14416df0ccfb4201c048153c6b23301.tar.bz2
* generic/tclStringObj.c (UpdateStringOfString): Fix bug detected
by compiler warning about undefined "dst".
Diffstat (limited to 'generic/tclStringObj.c')
-rw-r--r--generic/tclStringObj.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/generic/tclStringObj.c b/generic/tclStringObj.c
index b4e5995..1f221f9 100644
--- a/generic/tclStringObj.c
+++ b/generic/tclStringObj.c
@@ -33,7 +33,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclStringObj.c,v 1.70.2.9 2009/04/07 18:37:23 dgp Exp $ */
+ * RCS: @(#) $Id: tclStringObj.c,v 1.70.2.10 2009/04/10 21:27:17 dgp Exp $ */
#include "tclInt.h"
#include "tommath.h"
@@ -2934,12 +2934,12 @@ UpdateStringOfString(
Tcl_Panic("max size for a Tcl value (%d bytes) exceeded", INT_MAX);
}
- dst = (char *) ckalloc((unsigned) (size + 1));
- objPtr->bytes = dst;
+ objPtr->bytes = (char *) ckalloc((unsigned) (size + 1));
objPtr->length = size;
stringPtr->allocated = size;
copyBytes:
+ dst = objPtr->bytes;
for (i = 0; i < stringPtr->numChars; i++) {
dst += Tcl_UniCharToUtf(unicode[i], dst);
}