diff options
author | dgp <dgp@users.sourceforge.net> | 2009-04-10 21:27:17 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2009-04-10 21:27:17 (GMT) |
commit | f98c78b6a077737cbda73f643aa3a9dc87893ad8 (patch) | |
tree | 0db8e2ef5a7b5c423ad50fd0d0add26111e0fd82 | |
parent | 378202fab847a2ea292310e3322a08c2f67c2ca2 (diff) | |
download | tcl-f98c78b6a077737cbda73f643aa3a9dc87893ad8.zip tcl-f98c78b6a077737cbda73f643aa3a9dc87893ad8.tar.gz tcl-f98c78b6a077737cbda73f643aa3a9dc87893ad8.tar.bz2 |
* generic/tclStringObj.c (UpdateStringOfString): Fix bug detected
by compiler warning about undefined "dst".
-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); } |