summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2009-01-08 17:58:59 (GMT)
committerdgp <dgp@users.sourceforge.net>2009-01-08 17:58:59 (GMT)
commit06b98b063ae2d87532d9940f8ff0a6409fa86f58 (patch)
tree17f5554fb6076a19a94d98dbc70fd707a9b6733f
parenta23a10f4460267a77fa20b723239edaf3a5ce877 (diff)
downloadtcl-06b98b063ae2d87532d9940f8ff0a6409fa86f58.zip
tcl-06b98b063ae2d87532d9940f8ff0a6409fa86f58.tar.gz
tcl-06b98b063ae2d87532d9940f8ff0a6409fa86f58.tar.bz2
* generic/tclStringObj.c (STRING_UALLOC): Added missing parens
required to get correct results out of things like STRING_UALLOC(num + append). [Bug 2494093].
-rw-r--r--ChangeLog6
-rw-r--r--generic/tclStringObj.c4
2 files changed, 8 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 032f976..df08fe7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2009-01-08 Don Porter <dgp@users.sourceforge.net>
+
+ * generic/tclStringObj.c (STRING_UALLOC): Added missing parens
+ required to get correct results out of things like
+ STRING_UALLOC(num + append). [Bug 2494093].
+
2009-01-08 Donal K. Fellows <dkf@users.sf.net>
* generic/tclDictObj.c, generic/tclIndexObj.c, generic/tclListObj.c,
diff --git a/generic/tclStringObj.c b/generic/tclStringObj.c
index abbd027..c834de5 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.76 2008/12/17 16:47:38 nijtmans Exp $ */
+ * RCS: @(#) $Id: tclStringObj.c,v 1.77 2009/01/08 17:58:59 dgp Exp $ */
#include "tclInt.h"
#include "tommath.h"
@@ -106,7 +106,7 @@ typedef struct String {
} String;
#define STRING_UALLOC(numChars) \
- (numChars * sizeof(Tcl_UniChar))
+ ((numChars) * sizeof(Tcl_UniChar))
#define STRING_SIZE(ualloc) \
((unsigned) ((ualloc) \
? sizeof(String) - sizeof(Tcl_UniChar) + (ualloc) \