/*
-Copyright (C) 2004 Parallel Realities
+Copyright (C) 2004-2011 Parallel Realities
+Copyright (C) 2011-2015 Perpendicular Dimensions
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
int x = 300;
char text[25];
- strcpy(text, "");
+ text[0] = 0;
// joysticks have a button 0 so we can't
// do the same thing as the keyboard(!)
- if (*widget->value <= -1000)
+ if (*widget->value < -2)
{
- sprintf(text, "...");
+ snprintf(text, sizeof text, "...");
}
else if (*widget->value == -2)
{
- sprintf(text, "N/A");
+ snprintf(text, sizeof text, "N/A");
}
else
{
- sprintf(text, "Button #%d", *widget->value);
+ snprintf(text, sizeof text, "Button #%d", *widget->value);
}
graphics.drawString(text, x, widget->y, TXT_LEFT, graphics.screen);