summaryrefslogtreecommitdiffstats
path: root/generic/tkCanvPoly.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2020-03-20 08:31:04 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2020-03-20 08:31:04 (GMT)
commit522f8027b2de092fb9684f8135dedc0aba75217c (patch)
treecd2c4c457e71e8ea2303c50cf887eb3d15bc6d87 /generic/tkCanvPoly.c
parent55b8b289c6821cff7faa7552c53d0ee5d11e93f4 (diff)
downloadtk-522f8027b2de092fb9684f8135dedc0aba75217c.zip
tk-522f8027b2de092fb9684f8135dedc0aba75217c.tar.gz
tk-522f8027b2de092fb9684f8135dedc0aba75217c.tar.bz2
More usage of (internal) TkGetIntForIndex() function, and give this function an additional parameter "lastOK". This way,
"end" doesn't need to be handled especially in other code places, all is centralized in this single functions. Only Ttk's "treeview" not done yet, since that requires handling a linked list in stead of an array.
Diffstat (limited to 'generic/tkCanvPoly.c')
-rw-r--r--generic/tkCanvPoly.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/generic/tkCanvPoly.c b/generic/tkCanvPoly.c
index f2fef26..658bf23 100644
--- a/generic/tkCanvPoly.c
+++ b/generic/tkCanvPoly.c
@@ -1682,7 +1682,7 @@ GetPolygonIndex(
const char *string;
TkSizeT count = 2*(polyPtr->numPoints - polyPtr->autoClosed);
- if (TCL_OK == TkGetIntForIndex(obj, (INT_MAX) - ((INT_MAX) % count), &idx)) {
+ if (TCL_OK == TkGetIntForIndex(obj, (INT_MAX - 1) - ((INT_MAX) % count), 1, &idx)) {
if (idx == TCL_INDEX_NONE) {
idx = 0;
} else {