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:
cjdebenh
2000-12-28 05:30:53 +00:00
parent 3f65d9d371
commit 44ad386d74
+1
View File
@@ -177,6 +177,7 @@ draw_frame (LL * list, char fscroll, int left, int top, int right, int bottom, i
case WID_STRING:
if ((w->x > 0) && (w->y > 0) && (w->text)) {
if ((w->y <= hgt + fy) && (w->y > fy)) {
if (w->x > wid) { w->x=wid; };
strncpy (str, w->text, wid - w->x + 1);
str[wid - w->x + 1] = 0;
lcd.string (w->x + left, w->y + top - fy, str);