Quick patch to add sanity checking incase w->x is not set to a valid value.
I encountered this problem being caused by a variety of client. Line added is #180
This commit is contained in:
@@ -177,6 +177,7 @@ draw_frame (LL * list, char fscroll, int left, int top, int right, int bottom, i
|
|||||||
case WID_STRING:
|
case WID_STRING:
|
||||||
if ((w->x > 0) && (w->y > 0) && (w->text)) {
|
if ((w->x > 0) && (w->y > 0) && (w->text)) {
|
||||||
if ((w->y <= hgt + fy) && (w->y > fy)) {
|
if ((w->y <= hgt + fy) && (w->y > fy)) {
|
||||||
|
if (w->x > wid) { w->x=wid; };
|
||||||
strncpy (str, w->text, wid - w->x + 1);
|
strncpy (str, w->text, wid - w->x + 1);
|
||||||
str[wid - w->x + 1] = 0;
|
str[wid - w->x + 1] = 0;
|
||||||
lcd.string (w->x + left, w->y + top - fy, str);
|
lcd.string (w->x + left, w->y + top - fy, str);
|
||||||
|
|||||||
Reference in New Issue
Block a user