summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--generic/tkCanvText.c8
-rw-r--r--generic/tkFrame.c12
-rw-r--r--generic/tkSelect.c2
-rw-r--r--generic/tkText.c2
-rw-r--r--generic/tkTextMark.c4
-rw-r--r--unix/tkUnixSelect.c2
6 files changed, 15 insertions, 15 deletions
diff --git a/generic/tkCanvText.c b/generic/tkCanvText.c
index b9607a5..d358fb3 100644
--- a/generic/tkCanvText.c
+++ b/generic/tkCanvText.c
@@ -1388,13 +1388,13 @@ GetTextIndex(
c = string[0];
- if ((c == 'e') && (strncmp(string, "end", (unsigned) length) == 0)) {
+ if ((c == 'e') && (strncmp(string, "end", length) == 0)) {
*indexPtr = textPtr->numChars;
} else if ((c == 'i')
- && (strncmp(string, "insert", (unsigned) length) == 0)) {
+ && (strncmp(string, "insert", length) == 0)) {
*indexPtr = textPtr->insertPos;
} else if ((c == 's') && (length >= 5)
- && (strncmp(string, "sel.first", (unsigned) length) == 0)) {
+ && (strncmp(string, "sel.first", length) == 0)) {
if (textInfoPtr->selItemPtr != itemPtr) {
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"selection isn't in item", -1));
@@ -1403,7 +1403,7 @@ GetTextIndex(
}
*indexPtr = textInfoPtr->selectFirst;
} else if ((c == 's') && (length >= 5)
- && (strncmp(string, "sel.last", (unsigned) length) == 0)) {
+ && (strncmp(string, "sel.last", length) == 0)) {
if (textInfoPtr->selItemPtr != itemPtr) {
Tcl_SetObjResult(interp, Tcl_NewStringObj(
"selection isn't in item", -1));
diff --git a/generic/tkFrame.c b/generic/tkFrame.c
index 0edd4c2..746f3eb 100644
--- a/generic/tkFrame.c
+++ b/generic/tkFrame.c
@@ -826,17 +826,17 @@ FrameWidgetObjCmd(
}
c = arg[1];
if (((c == 'c') && (length >= 2)
- && (strncmp(arg, "-class", (unsigned)length) == 0))
+ && (strncmp(arg, "-class", length) == 0))
|| ((c == 'c') && (length >= 3)
- && (strncmp(arg, "-colormap", (unsigned)length) == 0))
+ && (strncmp(arg, "-colormap", length) == 0))
|| ((c == 'c') && (length >= 3)
- && (strncmp(arg, "-container", (unsigned)length) == 0))
+ && (strncmp(arg, "-container", length) == 0))
|| ((c == 's') && (framePtr->type == TYPE_TOPLEVEL)
- && (strncmp(arg, "-screen", (unsigned)length) == 0))
+ && (strncmp(arg, "-screen", length) == 0))
|| ((c == 'u') && (framePtr->type == TYPE_TOPLEVEL)
- && (strncmp(arg, "-use", (unsigned)length) == 0))
+ && (strncmp(arg, "-use", length) == 0))
|| ((c == 'v')
- && (strncmp(arg, "-visual", (unsigned)length) == 0))) {
+ && (strncmp(arg, "-visual", length) == 0))) {
#ifdef SUPPORT_CONFIG_EMBEDDED
if (c == 'u') {
diff --git a/generic/tkSelect.c b/generic/tkSelect.c
index 85865de..b2dd0d9 100644
--- a/generic/tkSelect.c
+++ b/generic/tkSelect.c
@@ -1508,7 +1508,7 @@ TkSelDefaultSelection(
Tcl_DStringFree(&ds);
return -1;
}
- memcpy(buffer, Tcl_DStringValue(&ds), (unsigned) (1+length));
+ memcpy(buffer, Tcl_DStringValue(&ds), length + 1);
Tcl_DStringFree(&ds);
*typePtr = XA_ATOM;
return length;
diff --git a/generic/tkText.c b/generic/tkText.c
index 7e09bfd..a738c57 100644
--- a/generic/tkText.c
+++ b/generic/tkText.c
@@ -6031,7 +6031,7 @@ SearchCore(
*/
p = startOfLine + lastOffset - firstNewLine - 1;
- if (strncmp(p, pattern, (unsigned) firstNewLine + 1)) {
+ if (strncmp(p, pattern, firstNewLine + 1)) {
/*
* No match.
*/
diff --git a/generic/tkTextMark.c b/generic/tkTextMark.c
index aca08fb..c516697 100644
--- a/generic/tkTextMark.c
+++ b/generic/tkTextMark.c
@@ -162,10 +162,10 @@ TkTextMarkCmd(
}
str = TkGetStringFromObj(objv[4],&length);
c = str[0];
- if ((c == 'l') && (strncmp(str, "left", (unsigned) length) == 0)) {
+ if ((c == 'l') && (strncmp(str, "left", length) == 0)) {
newTypePtr = &tkTextLeftMarkType;
} else if ((c == 'r') &&
- (strncmp(str, "right", (unsigned) length) == 0)) {
+ (strncmp(str, "right", length) == 0)) {
newTypePtr = &tkTextRightMarkType;
} else {
Tcl_SetObjResult(interp, Tcl_ObjPrintf(
diff --git a/unix/tkUnixSelect.c b/unix/tkUnixSelect.c
index 5b450f4..3009873 100644
--- a/unix/tkUnixSelect.c
+++ b/unix/tkUnixSelect.c
@@ -919,7 +919,7 @@ ConvertSelection(
/*
* Nobody seems to know about this kind of request. If it's of a
* sort that we can handle without any help, do it. Otherwise mark
- * the request as an errror.
+ * the request as an error.
*/
numItems = TkSelDefaultSelection(infoPtr, target, (char *) buffer,