summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--generic/tclStringObj.c4
-rw-r--r--generic/tclUtf.c3
3 files changed, 10 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 556116a..af98add 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2009-02-11 Don Porter <dgp@users.sourceforge.net>
+
+ * generic/tclStringObj.c: Changed type of the 'allocated' field
+ of the String struct from size_t to int since only int values are
+ ever stored in it.
+
2009-02-10 Jan Nijtmans <nijtmans@users.sf.net>
* generic/tclEncoding.c Eliminate some unnessary type casts
diff --git a/generic/tclStringObj.c b/generic/tclStringObj.c
index b2dd292..3fa8528 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.95 2009/02/10 23:09:05 nijtmans Exp $ */
+ * RCS: @(#) $Id: tclStringObj.c,v 1.96 2009/02/11 15:28:56 dgp Exp $ */
#include "tclInt.h"
#include "tommath.h"
@@ -94,7 +94,7 @@ typedef struct String {
* means that there is a valid Unicode rep, or
* that the number of UTF bytes == the number
* of chars. */
- size_t allocated; /* The amount of space actually allocated for
+ int allocated; /* The amount of space actually allocated for
* the UTF string (minus 1 byte for the
* termination char). */
size_t uallocated; /* The amount of space actually allocated for
diff --git a/generic/tclUtf.c b/generic/tclUtf.c
index aed3ff7..16acab2 100644
--- a/generic/tclUtf.c
+++ b/generic/tclUtf.c
@@ -8,7 +8,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclUtf.c,v 1.38 2008/04/27 22:21:33 dkf Exp $
+ * RCS: @(#) $Id: tclUtf.c,v 1.39 2009/02/11 15:28:59 dgp Exp $
*/
#include "tclInt.h"
@@ -417,6 +417,7 @@ Tcl_UtfToUniCharDString(
*/
oldLength = Tcl_DStringLength(dsPtr);
+/* TODO: fix overreach! */
Tcl_DStringSetLength(dsPtr,
(int) ((oldLength + length + 1) * sizeof(Tcl_UniChar)));
wString = (Tcl_UniChar *) (Tcl_DStringValue(dsPtr) + oldLength);