mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-18 17:28:13 +00:00
Fixed crash when the joystick product name isn't available
This commit is contained in:
@@ -1811,7 +1811,7 @@ SDL_CreateJoystickName(Uint16 vendor, Uint16 product, const char *vendor_name, c
|
|||||||
size_t i, len;
|
size_t i, len;
|
||||||
|
|
||||||
/* Use the given name for the Nintendo Online NES Controllers */
|
/* Use the given name for the Nintendo Online NES Controllers */
|
||||||
if (SDL_strncmp(product_name, "NES Controller", 14) == 0) {
|
if (product_name && SDL_strncmp(product_name, "NES Controller", 14) == 0) {
|
||||||
return SDL_strdup(product_name);
|
return SDL_strdup(product_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user