Description: Improve some error checking on SDL_Init and SDL_SetVideoMode.
Author: Barry deFreese <bdefreese@debian.org>
Index: mousetrap-1.0c/src/mousetrap.cpp
===================================================================
--- mousetrap-1.0c.orig/src/mousetrap.cpp	2013-08-01 20:50:12.850774261 -0400
+++ mousetrap-1.0c/src/mousetrap.cpp	2013-08-01 20:54:22.756013474 -0400
@@ -346,13 +346,16 @@
     srand( (unsigned)time( NULL ) );
 
     /* initialize SDL. */
-    SDL_Init(SDL_INIT_VIDEO);
+    if (SDL_Init(SDL_INIT_VIDEO) < 0)
+        printf("Failed to initialized SDL: %s.\n", SDL_GetError());
 
     /* set the title bar */
     SDL_WM_SetCaption("MouseTrap", "MouseTrap");
 
     /* create window */
     screen = SDL_SetVideoMode(SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
+    if (screen == NULL)
+        printf("Failed to set video mode: %s.\n", SDL_GetError());
 
     /* load sprite */
     temp   = loadImage((char *)"data/images/sprite.bmp");
