ref: f2950b085bf483c461b390e2347808931e93a084
parent: 0477b1b63370b1e534643b574d3ee674591a218d
author: Clownacy <[email protected]>
date: Tue Apr 7 13:19:34 EDT 2020
Fix potential NULL being passed to printf
--- a/src/Backends/SDL2/Misc.cpp
+++ b/src/Backends/SDL2/Misc.cpp
@@ -41,7 +41,10 @@
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)