diff options
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | generic/tclStringObj.c | 6 |
2 files changed, 6 insertions, 3 deletions
@@ -13,6 +13,9 @@ * unix/configure: autoconf-2.59 * win/configure: + * generic/tclStringObj.c (UpdateStringOfString): Fix bug detected + by compiler warning about undefined "dst". + * tests/httpd: Backport new tests for http 2.7.3. * tests/http.tcl: 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); } |