From 8eada1f8c6ed0f3429324fc80239a011fb634e3e Mon Sep 17 00:00:00 2001 From: Mounir IDRASSI Date: Sun, 16 Jan 2022 16:40:49 +0100 Subject: Windows: Fix build error following merge --- src/Format/Tcformat.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Format/Tcformat.c b/src/Format/Tcformat.c index 30f35257..09ea91f7 100644 --- a/src/Format/Tcformat.c +++ b/src/Format/Tcformat.c @@ -11045,7 +11045,7 @@ BOOL CALLBACK AdvanceDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar for (ea = EAGetFirst (); ea != 0; ea = EAGetNext (ea)) { if (EAIsFormatEnabled (ea) && (!SysEncInEffect () || bSystemIsGPT || EAIsMbrSysEncEnabled (ea))) - AddComboPair (GetDlgItem (hwndDlg, IDC_COMBO_BOX), EAGetName (buf, ea, 1), ea); + AddComboPair (GetDlgItem (hwndDlg, IDC_COMBO_BOX), EAGetName (buf, ARRAYSIZE(buf), ea, 1), ea); } SelectAlgo (GetDlgItem (hwndDlg, IDC_COMBO_BOX), &nVolumeEA); @@ -11405,7 +11405,7 @@ BOOL CheckWord (char* search) Error ("ERROR_GETTING_PATH", MainDlg); } - wcsncpy(tmp, path, wcslen(path)); + StringCbCopyW(tmp, ARRAYSIZE(tmp), path); //detects the last '\' in order to remove the name of the exe file. Afterwards add .txt file in the path for (int i = wcslen(path); i > 1; i--) @@ -11419,7 +11419,7 @@ BOOL CheckWord (char* search) break; } } - destPathName = wcscat(tmp, destFileName); + StringCbCatW(tmp, sizeof(tmp), destFileName); std::ifstream fin(destPathName); std::copy(std::istream_iterator(fin), std::istream_iterator(), -- cgit v1.2.3