summaryrefslogtreecommitdiffstats
path: root/generic/tkCanvas.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tkCanvas.c')
-rw-r--r--generic/tkCanvas.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/generic/tkCanvas.c b/generic/tkCanvas.c
index 6972b18..23d8e04 100644
--- a/generic/tkCanvas.c
+++ b/generic/tkCanvas.c
@@ -1242,14 +1242,15 @@ CanvasWidgetCmd(
int isNew = 0;
Tcl_HashEntry *entryPtr;
const char *arg;
- int length;
+ size_t length;
if (objc < 3) {
Tcl_WrongNumArgs(interp, 2, objv, "type coords ?arg ...?");
result = TCL_ERROR;
goto done;
}
- arg = Tcl_GetStringFromObj(objv[2], &length);
+ arg = Tcl_GetString(objv[2]);
+ length = objv[2]->length;
c = arg[0];
/*
@@ -1261,7 +1262,7 @@ CanvasWidgetCmd(
Tcl_MutexLock(&typeListMutex);
for (typePtr = typeList; typePtr != NULL; typePtr = typePtr->nextPtr){
if ((c == typePtr->name[0])
- && (!strncmp(arg, typePtr->name, (unsigned)length))) {
+ && (!strncmp(arg, typePtr->name, length))) {
if (matchPtr != NULL) {
Tcl_MutexUnlock(&typeListMutex);
goto badType;