summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2009-01-08 17:57:32 (GMT)
committerdgp <dgp@users.sourceforge.net>2009-01-08 17:57:32 (GMT)
commit6f6d9966290325cb3c380aca5acd827f6b4748bd (patch)
tree460224d955fcb090df63e602dbc0db8397f02c18
parent21007eb5fa1a81fd34515e6412b38e7531dcf45c (diff)
downloadtcl-6f6d9966290325cb3c380aca5acd827f6b4748bd.zip
tcl-6f6d9966290325cb3c380aca5acd827f6b4748bd.tar.gz
tcl-6f6d9966290325cb3c380aca5acd827f6b4748bd.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 e4c4c29..b85283f 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].
+
2008-12-04 Don Porter <dgp@users.sourceforge.net>
* generic/tclIOUtil.c (Tcl_FSGetNormalizedPath): Added another
diff --git a/generic/tclStringObj.c b/generic/tclStringObj.c
index ab04253..73aec31 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.32.2.2 2006/09/24 21:15:11 msofer Exp $ */
+ * RCS: @(#) $Id: tclStringObj.c,v 1.32.2.3 2009/01/08 17:57:32 dgp Exp $ */
#include "tclInt.h"
@@ -104,7 +104,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) \