mirror of
https://github.com/encounter/SDL.git
synced 2025-12-18 17:35:39 +00:00
Added SDL_copyp to avoid size mismatch when copying values (thanks @1bsyl!)
Closes https://github.com/libsdl-org/SDL/pull/5811
This commit is contained in:
@@ -1572,7 +1572,7 @@ static void OS2_GetDisplayModes(_THIS, SDL_VideoDisplay *display)
|
||||
SDL_DisplayMode mode;
|
||||
|
||||
debug_os2("Enter");
|
||||
SDL_memcpy(&mode, &display->current_mode, sizeof(SDL_DisplayMode));
|
||||
SDL_copyp(&mode, &display->current_mode);
|
||||
mode.driverdata = (MODEDATA *) SDL_malloc(sizeof(MODEDATA));
|
||||
if (!mode.driverdata) return; /* yikes.. */
|
||||
SDL_memcpy(mode.driverdata, display->current_mode.driverdata, sizeof(MODEDATA));
|
||||
|
||||
@@ -120,7 +120,7 @@ Wayland_SetTextInputRect(_THIS, SDL_Rect *rect)
|
||||
if (driverdata->text_input_manager) {
|
||||
struct SDL_WaylandInput *input = driverdata->input;
|
||||
if (input != NULL && input->text_input) {
|
||||
SDL_memcpy(&input->text_input->cursor_rect, rect, sizeof(SDL_Rect));
|
||||
SDL_copyp(&input->text_input->cursor_rect, rect);
|
||||
zwp_text_input_v3_set_cursor_rectangle(input->text_input->text_input,
|
||||
rect->x,
|
||||
rect->y,
|
||||
|
||||
Reference in New Issue
Block a user