Fix potential NULL being passed to printf

This commit is contained in:
Clownacy 2020-04-07 17:19:34 +01:00
parent 0477b1b633
commit f2950b085b

View file

@ -41,7 +41,10 @@ void Backend_Init(void)
for (int i = 0; i < SDL_GetNumVideoDrivers(); ++i)
puts(SDL_GetVideoDriver(i));
printf("Selected SDL2 video driver: %s\n", SDL_GetCurrentVideoDriver());
const char *driver = SDL_GetCurrentVideoDriver();
if (driver != NULL)
printf("Selected SDL2 video driver: %s\n", driver);
}
void Backend_Deinit(void)