Skip to content

Commit

Permalink
Replace if() with SDL_assert()
Browse files Browse the repository at this point in the history
If the if statement was not fulfilled, the pointers passed would be silently left unfilled.
  • Loading branch information
Semphris authored and slouken committed Apr 15, 2024
1 parent f06f761 commit 0429f5d
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/video/wayland/SDL_waylandwindow.c
Expand Up @@ -2471,11 +2471,12 @@ void Wayland_SetWindowSize(SDL_VideoDevice *_this, SDL_Window *window)
void Wayland_GetWindowSizeInPixels(SDL_VideoDevice *_this, SDL_Window *window, int *w, int *h)
{
SDL_WindowData *data;
if (window->driverdata) {
data = window->driverdata;
*w = data->current.drawable_width;
*h = data->current.drawable_height;
}

SDL_assert(window->driverdata)

data = window->driverdata;
*w = data->current.drawable_width;
*h = data->current.drawable_height;
}

void Wayland_SetWindowTitle(SDL_VideoDevice *_this, SDL_Window *window)
Expand Down

0 comments on commit 0429f5d

Please sign in to comment.