mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-26 13:08:29 +00:00
Ensure that all functions that follow the SDL_GetStringRule return temporary memory
This commit is contained in:
@@ -63,19 +63,17 @@ int SDL_GetNumCameraDrivers(void)
|
||||
return SDL_arraysize(bootstrap) - 1;
|
||||
}
|
||||
|
||||
// this returns string literals, so there's no need to use SDL_FreeLater.
|
||||
const char *SDL_GetCameraDriver(int index)
|
||||
{
|
||||
if (index >= 0 && index < SDL_GetNumCameraDrivers()) {
|
||||
return bootstrap[index]->name;
|
||||
return SDL_CreateTemporaryString(bootstrap[index]->name);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// this returns string literals, so there's no need to use SDL_FreeLater.
|
||||
const char *SDL_GetCurrentCameraDriver(void)
|
||||
{
|
||||
return camera_driver.name;
|
||||
return SDL_CreateTemporaryString(camera_driver.name);
|
||||
}
|
||||
|
||||
char *SDL_GetCameraThreadName(SDL_Camera *device, char *buf, size_t buflen)
|
||||
|
Reference in New Issue
Block a user