diff --git a/src/win/CMakeLists.txt b/src/win/CMakeLists.txt index 3fcf28d1a..cdb52aaae 100644 --- a/src/win/CMakeLists.txt +++ b/src/win/CMakeLists.txt @@ -30,6 +30,9 @@ if(MSVC) target_sources(86Box PRIVATE 86Box.manifest) target_sources(plat PRIVATE win_opendir.c) + + # Append null to resource strings (fixes file dialogs) + set_property(SOURCE 86Box.rc PROPERTY COMPILE_FLAGS -n) endif() if(DINPUT) diff --git a/src/win/win_opendir.c b/src/win/win_opendir.c index d7755e372..5339f0713 100644 --- a/src/win/win_opendir.c +++ b/src/win/win_opendir.c @@ -17,8 +17,6 @@ * Copyright 1998-2007 MicroWalt Corporation * Copyright 2017 Fred N. van Kempen */ -#define UNICODE -#include #include #include #include @@ -158,10 +156,11 @@ readdir(DIR *p) default: /* regular entry. */ #ifdef UNICODE wcsncpy(p->dent.d_name, ffp->name, MAXNAMLEN+1); + p->dent.d_reclen = (char)wcslen(p->dent.d_name); #else strncpy(p->dent.d_name, ffp->name, MAXNAMLEN+1); + p->dent.d_reclen = (char)strlen(p->dent.d_name); #endif - p->dent.d_reclen = (char) wcslen(p->dent.d_name); } /* Read next entry. */ diff --git a/src/win/win_settings.c b/src/win/win_settings.c index 57fce16ba..067f7c9f9 100644 --- a/src/win/win_settings.c +++ b/src/win/win_settings.c @@ -5060,7 +5060,7 @@ static BOOL win_settings_categories_init_columns(HWND hdlg) { LVCOLUMN lvc; - int iCol; + int iCol = 0; HWND hwndList = GetDlgItem(hdlg, IDC_SETTINGSCATLIST); lvc.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM;