]> git.mxchange.org Git - quix0rs-blobwars.git/blobdiff - src/widgets.cpp
Mention that we are now using SDL2 in the manual and intro screen.
[quix0rs-blobwars.git] / src / widgets.cpp
old mode 100755 (executable)
new mode 100644 (file)
index eeeb841..e35594d
@@ -1,5 +1,6 @@
 /*
-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
@@ -126,21 +127,21 @@ void drawJoypadButtonOption(Widget *widget)
        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);