From 0e49b7bc33b0eb2c07956ec14bbde6f9b31c8ccd Mon Sep 17 00:00:00 2001 From: Mounir IDRASSI Date: Sun, 2 Jul 2023 22:36:33 +0200 Subject: Windows: Fix regression when creating multiple keyfiles with a fixed size --- src/Common/Dlgcode.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Common/Dlgcode.c b/src/Common/Dlgcode.c index 0c0cff03..1717c7db 100644 --- a/src/Common/Dlgcode.c +++ b/src/Common/Dlgcode.c @@ -7366,8 +7366,6 @@ BOOL CALLBACK KeyfileGeneratorDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LP SendMessage(hwndDlg, WM_NEXTDLGCTL, (WPARAM) GetDlgItem (hwndDlg, IDC_KEYFILES_SIZE), TRUE); return 1; } - - remainingBytes = keyfilesSize; } if (!GetWindowText(GetDlgItem (hwndDlg, IDC_KEYFILES_BASE_NAME), szFileBaseName, TC_MAX_PATH)) @@ -7468,9 +7466,10 @@ BOOL CALLBACK KeyfileGeneratorDlgProc (HWND hwndDlg, UINT msg, WPARAM wParam, LP keyfilesSize %= ((KEYFILE_MAX_READ_LEN - 64) + 1); keyfilesSize += 64; - remainingBytes = keyfilesSize; } + remainingBytes = keyfilesSize; + do { rndBytesLength = (int) min (remainingBytes, (unsigned long long) KEYFILE_MAX_READ_LEN); -- cgit v1.2.3