diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2022-03-22 20:07:43 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2022-03-22 20:07:43 (GMT) |
commit | 5516772e8b562cfd568293d3616bf1a0f493b752 (patch) | |
tree | 393f1847f7b918d84005c089e8c81113e6ee3e5b /generic/tclStringObj.c | |
parent | d4c27c94668a30f48edee251104255b27230107e (diff) | |
parent | abccdbc60065601867bb37fbaa0313341abc1b7d (diff) | |
download | tcl-5516772e8b562cfd568293d3616bf1a0f493b752.zip tcl-5516772e8b562cfd568293d3616bf1a0f493b752.tar.gz tcl-5516772e8b562cfd568293d3616bf1a0f493b752.tar.bz2 |
Merge 8.7
Diffstat (limited to 'generic/tclStringObj.c')
-rw-r--r-- | generic/tclStringObj.c | 6 |
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) \ |