Import Tk 8.6.10
This commit is contained in:
@@ -131,7 +131,7 @@ static void StateSpecUpdateString(Tcl_Obj *objPtr)
|
||||
unsigned int mask = onbits | offbits;
|
||||
Tcl_DString result;
|
||||
int i;
|
||||
size_t len;
|
||||
int len;
|
||||
|
||||
Tcl_DStringInit(&result);
|
||||
|
||||
@@ -147,14 +147,14 @@ static void StateSpecUpdateString(Tcl_Obj *objPtr)
|
||||
len = Tcl_DStringLength(&result);
|
||||
if (len) {
|
||||
/* 'len' includes extra trailing ' ' */
|
||||
objPtr->bytes = Tcl_Alloc(len);
|
||||
objPtr->bytes = ckalloc(len);
|
||||
objPtr->length = len-1;
|
||||
strncpy(objPtr->bytes, Tcl_DStringValue(&result), len-1);
|
||||
objPtr->bytes[len-1] = '\0';
|
||||
} else {
|
||||
/* empty string */
|
||||
objPtr->length = 0;
|
||||
objPtr->bytes = Tcl_Alloc(1);
|
||||
objPtr->bytes = ckalloc(1);
|
||||
*objPtr->bytes = '\0';
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user