From a84a48dc75c2fee52456a4a94f1f35d23def2309 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Wed, 20 Jul 2022 14:52:20 +0200 Subject: [PATCH] Fix #563: mismatched buffer sizes for memcpy --- desmume/src/frontend/posix/gtk/main.cpp | 2 +- desmume/src/frontend/posix/gtk2/main.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/desmume/src/frontend/posix/gtk/main.cpp b/desmume/src/frontend/posix/gtk/main.cpp index 8bbb159ad..172d2b2d2 100644 --- a/desmume/src/frontend/posix/gtk/main.cpp +++ b/desmume/src/frontend/posix/gtk/main.cpp @@ -1961,7 +1961,7 @@ static void Edit_Joystick_Controls(GSimpleAction *action, GVariant *parameter, g switch (gtk_dialog_run(GTK_DIALOG(ecDialog))) { case GTK_RESPONSE_OK: - memcpy(&joypad_cfg, &Keypad_Temp, sizeof(keyboard_cfg)); + memcpy(&joypad_cfg, &Keypad_Temp, sizeof(joypad_cfg)); desmume_config_update_joykeys(keyfile); break; case GTK_RESPONSE_CANCEL: diff --git a/desmume/src/frontend/posix/gtk2/main.cpp b/desmume/src/frontend/posix/gtk2/main.cpp index 2d60bd13d..55610d528 100644 --- a/desmume/src/frontend/posix/gtk2/main.cpp +++ b/desmume/src/frontend/posix/gtk2/main.cpp @@ -2365,7 +2365,7 @@ static void Edit_Joystick_Controls() switch (gtk_dialog_run(GTK_DIALOG(ecDialog))) { case GTK_RESPONSE_OK: - memcpy(&joypad_cfg, &Keypad_Temp, sizeof(keyboard_cfg)); + memcpy(&joypad_cfg, &Keypad_Temp, sizeof(joypad_cfg)); desmume_config_update_joykeys(keyfile); break; case GTK_RESPONSE_CANCEL: