mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-20 02:08:13 +00:00
SDL_Get*Driver() functions: Set error message on failure
This commit is contained in:

committed by
Sam Lantinga

parent
ed0a03e9b5
commit
c16b7bcb7a
@@ -810,8 +810,7 @@ const char *SDL_GetRenderDriver(int index)
|
||||
{
|
||||
#ifndef SDL_RENDER_DISABLED
|
||||
if (index < 0 || index >= SDL_GetNumRenderDrivers()) {
|
||||
SDL_SetError("index must be in the range of 0 - %d",
|
||||
SDL_GetNumRenderDrivers() - 1);
|
||||
SDL_InvalidParamError("index");
|
||||
return NULL;
|
||||
}
|
||||
return render_drivers[index]->name;
|
||||
|
Reference in New Issue
Block a user