Browse Source

wayland: Use SDL_memcpy instead of SDL_copyp to copy the repeated text string

SDL_copyp is not intended to copy arrays. Use SDL_memcpy with the explicit size instead.

(cherry picked from commit abcfa1b7de9abbf3eb80fcc6ff9a5efc5caac418)
Frank Praznik 3 months ago
parent
commit
d9db975b4b
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/video/wayland/SDL_waylandevents.c

+ 1 - 1
src/video/wayland/SDL_waylandevents.c

@@ -317,7 +317,7 @@ static void keyboard_repeat_set(SDL_WaylandKeyboardRepeat *repeat_info, Uint32 k
     repeat_info->next_repeat_ns = SDL_MS_TO_NS(repeat_info->repeat_delay_ms);
     repeat_info->next_repeat_ns = SDL_MS_TO_NS(repeat_info->repeat_delay_ms);
     repeat_info->scancode = scancode;
     repeat_info->scancode = scancode;
     if (has_text) {
     if (has_text) {
-        SDL_copyp(repeat_info->text, text);
+        SDL_memcpy(repeat_info->text, text, sizeof(repeat_info->text));
     } else {
     } else {
         repeat_info->text[0] = '\0';
         repeat_info->text[0] = '\0';
     }
     }