Skip to content

Commit 8ce176b

Browse files
Sackzementslouken
authored andcommitted
SDL_GetMouseNameForID(): Set an error message for invalid mouse IDs.
1 parent 51fa076 commit 8ce176b

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/events/SDL_mouse.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,7 @@ const char *SDL_GetMouseNameForID(SDL_MouseID instance_id)
428428
{
429429
int mouse_index = SDL_GetMouseIndex(instance_id);
430430
if (mouse_index < 0) {
431+
SDL_SetError("Mouse %" SDL_PRIu32 " not found", instance_id);
431432
return NULL;
432433
}
433434
return SDL_GetPersistentString(SDL_mice[mouse_index].name);

0 commit comments

Comments
 (0)