Skip to content

Commit

Permalink
prevent segfault in sdl.c
Browse files Browse the repository at this point in the history
prevent segfault in sdl.c
  • Loading branch information
RoboSchmied authored and jcalvinowens committed Jan 8, 2025
1 parent 58cdd71 commit 15b591e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sdl.c
Original file line number Diff line number Diff line change
Expand Up @@ -490,14 +490,14 @@ static int sdl_poll_one(struct sdl_ctx *c, SDL_Event *evt, uint16_t min,
case SDL_SCANCODE_UP:
c->crosshair_y--;
if (c->crosshair_y < 0)
c->crosshair_x = HEIGHT - 1;
c->crosshair_y = HEIGHT - 1;

break;

case SDL_SCANCODE_DOWN:
c->crosshair_y++;
if (c->crosshair_y >= HEIGHT)
c->crosshair_x = 0;
c->crosshair_y = 0;

break;

Expand Down

0 comments on commit 15b591e

Please sign in to comment.