summaryrefslogtreecommitdiffstats
path: root/generic/tclStringRep.h
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tclStringRep.h')
-rw-r--r--generic/tclStringRep.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/generic/tclStringRep.h b/generic/tclStringRep.h
index cac4d0b..faa2c2c 100644
--- a/generic/tclStringRep.h
+++ b/generic/tclStringRep.h
@@ -60,14 +60,14 @@ typedef struct {
} String;
#define STRING_MAXCHARS \
- (int)(((size_t)UINT_MAX - 1 - offsetof(String, unicode))/sizeof(unsigned short))
+ (int)(((size_t)UINT_MAX - offsetof(String, unicode))/sizeof(unsigned short) - 1)
#define STRING_SIZE(numChars) \
- (offsetof(String, unicode) + (((numChars) + 1U) * sizeof(unsigned short)))
+ (offsetof(String, unicode) + sizeof(unsigned short) + ((numChars) * sizeof(unsigned short)))
#define stringCheckLimits(numChars) \
do { \
if ((numChars) < 0 || (numChars) > STRING_MAXCHARS) { \
Tcl_Panic("max length for a Tcl unicode value (%d chars) exceeded", \
- (int)STRING_MAXCHARS); \
+ STRING_MAXCHARS); \
} \
} while (0)
#define stringAttemptAlloc(numChars) \