1 diff -ur blobwars-1.10.orig/src/widgets.cpp blobwars-1.10/src/widgets.cpp
2 --- blobwars-1.10.orig/src/widgets.cpp 2009-02-01 14:34:45.000000000 +0300
3 +++ blobwars-1.10/src/widgets.cpp 2009-02-27 22:01:52.000000000 +0300
6 char *c = widget->options;
18 - if (widget->enabled)
20 - graphics.setFontColor(0xff, 0xff, 0xff, 0x00, 0x00, 0x00);
21 - if (count == *widget->value)
22 - graphics.setFontColor(0x00, 0x00, 0x00, 0x00, 0xff, 0x00);
26 - graphics.setFontColor(0x77, 0x77, 0x77, 0x00, 0x00, 0x00);
29 - sprintf(token, "%s", token);
33 - text = graphics.getString(token, false);
34 + char *eow = strchr (c, '|');
36 + eow = strchr (c, 0);
38 + token_len = eow - c;
39 + if (token_len > sizeof (token) - 1)
40 + token_len = sizeof (token) - 1;
41 + memcpy (token, c, token_len);
42 + token [token_len] = 0;
48 - if ((widget->enabled) && (count == *widget->value))
49 - graphics.drawWidgetRect(x, widget->y, text->w, text->h);
51 - graphics.blit(text, x, widget->y, graphics.screen, false);
56 + if (widget->enabled)
58 + graphics.setFontColor(0xff, 0xff, 0xff, 0x00, 0x00, 0x00);
59 + if (count == *widget->value)
60 + graphics.setFontColor(0x00, 0x00, 0x00, 0x00, 0xff, 0x00);
64 - sprintf(token, "%s%c", token, *c);
65 + graphics.setFontColor(0x77, 0x77, 0x77, 0x00, 0x00, 0x00);
71 - if (widget->enabled)
73 - graphics.setFontColor(0xff, 0xff, 0xff, 0x00, 0x00, 0x00);
74 - if (count == *widget->value)
75 - graphics.setFontColor(0x00, 0x00, 0x00, 0x00, 0xff, 0x00);
79 - graphics.setFontColor(0x77, 0x77, 0x77, 0x00, 0x00, 0x00);
81 + text = graphics.getString(token, false);
83 - sprintf(token, "%s", token);
84 + if ((widget->enabled) && (count == *widget->value))
85 + graphics.drawWidgetRect(x, widget->y, text->w, text->h);
87 - text = graphics.getString(token, false);
88 + graphics.blit(text, x, widget->y, graphics.screen, false);
90 - if ((widget->enabled) && (count == *widget->value))
92 - graphics.drawWidgetRect(x, widget->y, text->w, text->h);
97 - graphics.blit(text, x, widget->y, graphics.screen, false);
108 - sprintf(text, "%s", Keyboard::translateKey(*widget->value));
110 - graphics.drawString(text, x, widget->y, TXT_LEFT, graphics.screen);
111 + graphics.drawString(Keyboard::translateKey(*widget->value),
112 + x, widget->y, TXT_LEFT, graphics.screen);