diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2018-07-10 19:22:52 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2018-07-10 19:22:52 (GMT) |
commit | 9ab7c17b2d46b1dfa2b26a297f44ace4cb2d39d1 (patch) | |
tree | 9a64e19f0af7f9ec141c6424a0124f86dc766488 /generic/ttk | |
parent | ac8ab4d638645c3ac8828e9aa4000c99df68c019 (diff) | |
download | tk-9ab7c17b2d46b1dfa2b26a297f44ace4cb2d39d1.zip tk-9ab7c17b2d46b1dfa2b26a297f44ace4cb2d39d1.tar.gz tk-9ab7c17b2d46b1dfa2b26a297f44ace4cb2d39d1.tar.bz2 |
Make Tk sufficiently 64-bit aware in order to withstand TIP #494 possible problems
Diffstat (limited to 'generic/ttk')
-rw-r--r-- | generic/ttk/ttkState.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/generic/ttk/ttkState.c b/generic/ttk/ttkState.c index c34b900..2941ca8 100644 --- a/generic/ttk/ttkState.c +++ b/generic/ttk/ttkState.c @@ -130,7 +130,8 @@ static void StateSpecUpdateString(Tcl_Obj *objPtr) unsigned int offbits = objPtr->internalRep.longValue & 0x0000FFFF; unsigned int mask = onbits | offbits; Tcl_DString result; - int i, len; + int i; + size_t len; Tcl_DStringInit(&result); @@ -146,9 +147,9 @@ static void StateSpecUpdateString(Tcl_Obj *objPtr) len = Tcl_DStringLength(&result); if (len) { /* 'len' includes extra trailing ' ' */ - objPtr->bytes = Tcl_Alloc((unsigned)len); + objPtr->bytes = Tcl_Alloc(len); objPtr->length = len-1; - strncpy(objPtr->bytes, Tcl_DStringValue(&result), (size_t)len-1); + strncpy(objPtr->bytes, Tcl_DStringValue(&result), len-1); objPtr->bytes[len-1] = '\0'; } else { /* empty string */ |