OSDN Git Service

.
authorK.Ohta <whatisthis.sowhat@gmail.com>
Tue, 24 Sep 2019 22:38:29 +0000 (07:38 +0900)
committerK.Ohta <whatisthis.sowhat@gmail.com>
Tue, 24 Sep 2019 22:38:29 +0000 (07:38 +0900)
source/src/config.cpp

index f5a12dd..07b6515 100644 (file)
@@ -481,11 +481,9 @@ void DLL_PREFIX load_config(const _TCHAR *config_path)
                // Assigning joysticks.
                for(i = 0; i < 16; i++) {
                        _TCHAR name[256];
-                                               memset(config.assigned_joystick_name[i], 0x00, sizeof(_TCHAR) * 256);
-
                        my_stprintf_s(name, 255, _T("AssignedJoystick%d"), i + 1);
                        MyGetPrivateProfileString(_T("Qt"), (const _TCHAR *)name, _T(""),
-                                                                         config.assigned_joystick_name[i], 255, config_path);
+                                                                         config.assigned_joystick_name[i], sizeof(config.assigned_joystick_name[i]) - 1, config_path);
                }
 
                // Extra UI