Skip to content

Commit

Permalink
prevent cursor from going out of bounds
Browse files Browse the repository at this point in the history
  • Loading branch information
Cristy committed Dec 4, 2024
1 parent 5bd92ae commit 85ad0f7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion magick/widget.c
Original file line number Diff line number Diff line change
Expand Up @@ -1168,7 +1168,8 @@ static void XEditText(Display *display,XWidgetInfo *text_info,
q=text_info->text+Extent(text_info->text)+strlen(text);
for (i=0; i <= Extent(text_info->cursor); i++)
{
*q=(*(q-Extent(text)));
if ((q-Extent(text)) > text_info->text)
*q=(*(q-Extent(text)));
q--;
}
p=text;
Expand Down

0 comments on commit 85ad0f7

Please sign in to comment.