summaryrefslogtreecommitdiffstats
path: root/generic/tkCanvLine.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2020-02-17 13:45:28 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2020-02-17 13:45:28 (GMT)
commitea4d13918933512ff2862948eeca88fcaa4b33e0 (patch)
tree4cc890357b5fb58eef2fea4f4021db55f4fe68ec /generic/tkCanvLine.c
parentcff22045631cb46abfc907be254c48a3c90c06d2 (diff)
downloadtk-ea4d13918933512ff2862948eeca88fcaa4b33e0.zip
tk-ea4d13918933512ff2862948eeca88fcaa4b33e0.tar.gz
tk-ea4d13918933512ff2862948eeca88fcaa4b33e0.tar.bz2
Clamp output of listbox indexes to be >= -1 always. Many other's (like menu's, entries) already do that. Doesn't make really a difference, as -2 is just as invalid as -1.
Diffstat (limited to 'generic/tkCanvLine.c')
-rw-r--r--generic/tkCanvLine.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/generic/tkCanvLine.c b/generic/tkCanvLine.c
index 5f2dcb7..a59f675 100644
--- a/generic/tkCanvLine.c
+++ b/generic/tkCanvLine.c
@@ -1783,7 +1783,7 @@ GetLineIndex(
coordPtr += 2;
}
} else {
- if (Tcl_GetIntFromObj(interp, obj, indexPtr) != TCL_OK) {
+ if (Tcl_GetIntFromObj(NULL, obj, indexPtr) != TCL_OK) {
goto badIndex;
}
*indexPtr &= -2; /* If index is odd, make it even. */
@@ -1801,7 +1801,6 @@ GetLineIndex(
*/
badIndex:
- Tcl_ResetResult(interp);
Tcl_SetObjResult(interp, Tcl_ObjPrintf("bad index \"%s\"", string));
Tcl_SetErrorCode(interp, "TK", "CANVAS", "ITEM_INDEX", "LINE", NULL);
return TCL_ERROR;