mirror of
https://github.com/yawut/SDL.git
synced 2026-08-28 03:34:44 -05:00
Fixed crash if SDL_VideoDriverName() is passed a NULL namebuf
This commit is contained in:
@@ -57,8 +57,12 @@ SDL_VideoDriverName(char *namebuf, int maxlen)
|
||||
{
|
||||
const char *name = SDL_GetCurrentVideoDriver();
|
||||
if (name) {
|
||||
SDL_strlcpy(namebuf, name, maxlen);
|
||||
return namebuf;
|
||||
if (namebuf) {
|
||||
SDL_strlcpy(namebuf, name, maxlen);
|
||||
return namebuf;
|
||||
} else {
|
||||
return name;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user