summaryrefslogtreecommitdiffstats
path: root/macosx/tkMacOSXFont.c
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2017-01-01 20:56:48 (GMT)
committerfvogel <fvogelnew1@free.fr>2017-01-01 20:56:48 (GMT)
commitf85e7916a82767bfc0f9fdffbc13edb698456c06 (patch)
tree84a19a6071d6cd40efcef8fc0c19954f8b3253e1 /macosx/tkMacOSXFont.c
parente10f92249af8322f5e4d9f1fae6bcdd21f00924d (diff)
downloadtk-f85e7916a82767bfc0f9fdffbc13edb698456c06.zip
tk-f85e7916a82767bfc0f9fdffbc13edb698456c06.tar.gz
tk-f85e7916a82767bfc0f9fdffbc13edb698456c06.tar.bz2
Fix [28a4535fa2]: Off-by-1 error on text widget index on OS X
Diffstat (limited to 'macosx/tkMacOSXFont.c')
-rw-r--r--macosx/tkMacOSXFont.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/macosx/tkMacOSXFont.c b/macosx/tkMacOSXFont.c
index d3e0e41..db36731 100644
--- a/macosx/tkMacOSXFont.c
+++ b/macosx/tkMacOSXFont.c
@@ -870,7 +870,7 @@ TkpMeasureCharsInContext(
if (index <= start && !(flags & TK_WHOLE_WORDS)) {
index = CTTypesetterSuggestClusterBreak(typesetter, start, maxWidth);
}
- cs = (index < len || (flags & TK_WHOLE_WORDS)) ?
+ cs = (index < len && (flags & TK_WHOLE_WORDS)) ?
whitespaceCharacterSet : lineendingCharacterSet;
while (index > start &&
[cs characterIsMember:[string characterAtIndex:(index - 1)]]) {