summaryrefslogtreecommitdiffstats
path: root/generic/tclStringObj.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2022-03-22 20:07:43 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2022-03-22 20:07:43 (GMT)
commit5516772e8b562cfd568293d3616bf1a0f493b752 (patch)
tree393f1847f7b918d84005c089e8c81113e6ee3e5b /generic/tclStringObj.c
parentd4c27c94668a30f48edee251104255b27230107e (diff)
parentabccdbc60065601867bb37fbaa0313341abc1b7d (diff)
downloadtcl-5516772e8b562cfd568293d3616bf1a0f493b752.zip
tcl-5516772e8b562cfd568293d3616bf1a0f493b752.tar.gz
tcl-5516772e8b562cfd568293d3616bf1a0f493b752.tar.bz2
Merge 8.7
Diffstat (limited to 'generic/tclStringObj.c')
-rw-r--r--generic/tclStringObj.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/generic/tclStringObj.c b/generic/tclStringObj.c
index 2b11877..d43c507 100644
--- a/generic/tclStringObj.c
+++ b/generic/tclStringObj.c
@@ -145,14 +145,14 @@ typedef struct {
} UniCharString;
#define UNICHAR_STRING_MAXCHARS \
- (int)(((size_t)UINT_MAX - 1 - offsetof(UniCharString, unicode))/sizeof(Tcl_UniChar))
+ (int)(((size_t)UINT_MAX - offsetof(UniCharString, unicode))/sizeof(Tcl_UniChar) - 1)
#define UNICHAR_STRING_SIZE(numChars) \
- (offsetof(UniCharString, unicode) + (((numChars) + 1U) * sizeof(Tcl_UniChar)))
+ (offsetof(UniCharString, unicode) + sizeof(Tcl_UniChar) + ((numChars) * sizeof(Tcl_UniChar)))
#define uniCharStringCheckLimits(numChars) \
do { \
if ((numChars) < 0 || (numChars) > UNICHAR_STRING_MAXCHARS) { \
Tcl_Panic("max length for a Tcl unicode value (%d chars) exceeded", \
- (int)UNICHAR_STRING_MAXCHARS); \
+ UNICHAR_STRING_MAXCHARS); \
} \
} while (0)
#define uniCharStringAttemptAlloc(numChars) \