diff --git a/src/win/win_settings.c b/src/win/win_settings.c index 8b9dff3c8..84d257b34 100644 --- a/src/win/win_settings.c +++ b/src/win/win_settings.c @@ -3731,7 +3731,7 @@ static void win_settings_floppy_drives_update_item(HWND hwndList, int i) { LVITEM lvI; - char s[256]; + char s[256], *t; WCHAR szText[256]; lvI.mask = LVIF_TEXT | LVIF_IMAGE | LVIF_STATE; @@ -3741,7 +3741,11 @@ win_settings_floppy_drives_update_item(HWND hwndList, int i) lvI.iItem = i; if (temp_fdd_types[i] > 0) { - strcpy(s, fdd_getname(temp_fdd_types[i])); + t = fdd_getname(temp_fdd_types[i]); + if (strlen(t) <= 256) + strcpy(s, t); + else + strncpy(s, t, 256); mbstowcs(szText, s, strlen(s) + 1); lvI.pszText = szText; } else