From 75c13c9b7badb1d8ced874cccef57a6e37a85519 Mon Sep 17 00:00:00 2001 From: Mounir IDRASSI Date: Wed, 5 Aug 2020 18:51:56 +0200 Subject: Windows: Fix wrong error message when UTF-8 encoding of entered password exceeds the maximum supported length. --- src/Common/Dlgcode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Common/Dlgcode.c b/src/Common/Dlgcode.c index 42d93224..28eb3803 100644 --- a/src/Common/Dlgcode.c +++ b/src/Common/Dlgcode.c @@ -13251,7 +13251,6 @@ BOOL GetPassword (HWND hwndDlg, UINT ctrlID, char* passValue, int bufSize, BOOL passValue [0] = 0; if (bShowError) { - SetFocus (GetDlgItem(hwndDlg, ctrlID)); if (GetLastError () == ERROR_INSUFFICIENT_BUFFER) { DWORD dwTextSize = (DWORD) wcslen (GetString ("PASSWORD_UTF8_TOO_LONG")) + 16; @@ -13266,6 +13265,7 @@ BOOL GetPassword (HWND hwndDlg, UINT ctrlID, char* passValue, int bufSize, BOOL } else Error ("PASSWORD_UTF8_INVALID", hwndDlg); + SetFocus (GetDlgItem(hwndDlg, ctrlID)); } } -- cgit v1.2.3