/* A simple program to test the text rendering feature of the TTF library */
-/* quiet windows compiler warnings */\r
-#define _CRT_SECURE_NO_WARNINGS\r
+/* quiet windows compiler warnings */
+#define _CRT_SECURE_NO_WARNINGS
#include <stdlib.h>
#include <stdio.h>
if( glyph ) {
char outname[64];
- sprintf( outname, "glyph-%d.bmp", i );
+ snprintf(outname, 12, "glyph-%d.bmp", i );
SDL_SaveBMP( glyph, outname );
}
}
/* Show which font file we're looking at */
- sprintf(string, "Font file: %s", argv[0]); /* possible overflow */
+ snprintf(string, 11 + strlen(argv[0]), "Font file: %s", argv[0]); /* possible overflow */
if ( rendersolid ) {
text = TTF_RenderText_Solid(font, string, *forecol);
} else {
SDL_DBusContext *dbus = SDL_DBus_GetContext();
char **paths = NULL;
int i, numpaths = 0;
+ if(!dbus) {
+ return retval;
+ }
if (!SDL_DBus_CallMethodOnConnection(dbus->system_conn, UPOWER_DBUS_NODE, UPOWER_DBUS_PATH, UPOWER_DBUS_INTERFACE, "EnumerateDevices",
DBUS_TYPE_INVALID,