mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-22 22:28:02 +01:00
- Fixed bug that could cause SIGSEGV by accessing beyond the end of text in
a WINGs textfield widget.
This commit is contained in:
@@ -66,6 +66,8 @@ Changes since version 0.80.2:
|
||||
- Fixed bug in wmsetbg that caused scale and maxscale to both do maxscale
|
||||
(Alexey Voinov <voins@voins.program.ru>)
|
||||
- Fixed bug with scrolling menus introduced by the xinerama patch.
|
||||
- Fixed bug that could cause SIGSEGV by accessing beyond the end of text in
|
||||
a WINGs textfield widget.
|
||||
|
||||
|
||||
Changes since version 0.80.1:
|
||||
|
||||
@@ -53,6 +53,8 @@ Changes since wmaker 0.80.1:
|
||||
- Added WMGetFontName()
|
||||
- Added fontpanel callback
|
||||
- Added WMSetTableViewHasHorizontalScroller()
|
||||
- Fixed bug that could cause SIGSEGV by accessing beyond the end of text in
|
||||
a WINGs textfield widget.
|
||||
|
||||
|
||||
Changes since wmaker 0.80.0:
|
||||
|
||||
@@ -1335,12 +1335,13 @@ pointToCursorPosition(TextField *tPtr, int x)
|
||||
if (tPtr->flags.bordered)
|
||||
x -= 2;
|
||||
|
||||
a = tPtr->viewPosition;
|
||||
b = tPtr->viewPosition + tPtr->textLen;
|
||||
if (WMWidthOfString(tPtr->font, &(tPtr->text[tPtr->viewPosition]),
|
||||
tPtr->textLen - tPtr->viewPosition) < x)
|
||||
return tPtr->textLen;
|
||||
|
||||
a = tPtr->viewPosition;
|
||||
b = tPtr->textLen;
|
||||
|
||||
while (a < b && b-a>1) {
|
||||
mid = (a+b)/2;
|
||||
tw = WMWidthOfString(tPtr->font, &(tPtr->text[tPtr->viewPosition]),
|
||||
@@ -1352,6 +1353,7 @@ pointToCursorPosition(TextField *tPtr, int x)
|
||||
else
|
||||
return mid;
|
||||
}
|
||||
|
||||
return (a+b)/2;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user