From 01de930753fd7a5d47c0350a4361949d770b93cf Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Mon, 22 Jul 2013 13:38:03 +0000 Subject: replace sprintf to mir_snprintf (part 1) git-svn-id: http://svn.miranda-ng.org/main/trunk@5446 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/NewsAggregator/Src/Authentication.cpp | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) (limited to 'plugins/NewsAggregator/Src') diff --git a/plugins/NewsAggregator/Src/Authentication.cpp b/plugins/NewsAggregator/Src/Authentication.cpp index 7d3c2d703d..4503fc7ef9 100644 --- a/plugins/NewsAggregator/Src/Authentication.cpp +++ b/plugins/NewsAggregator/Src/Authentication.cpp @@ -57,24 +57,21 @@ INT_PTR CALLBACK AuthenticationProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA { switch (msg) { case WM_INITDIALOG: - TranslateDialogDefault(hwndDlg); { + TranslateDialogDefault(hwndDlg); ItemInfo &SelItem = *(ItemInfo*)lParam; SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG)&SelItem); - if (SelItem.hwndList) - { + if (SelItem.hwndList) { TCHAR str[MAX_PATH]; if (GetDlgItemText(SelItem.hwndList, IDC_FEEDTITLE, str, SIZEOF(str))) SetDlgItemText(hwndDlg, IDC_FEEDNAME, str); - else - { + else { GetDlgItemText(SelItem.hwndList, IDC_FEEDURL, str, SIZEOF(str)); SetDlgItemText(hwndDlg, IDC_FEEDNAME, str); } } - else if (SelItem.hContact) - { + else if (SelItem.hContact) { DBVARIANT dbv; if (!db_get_ts(SelItem.hContact, MODULE, "Nick", &dbv)) { SetDlgItemText(hwndDlg, IDC_FEEDNAME, dbv.ptszVal); @@ -96,23 +93,21 @@ INT_PTR CALLBACK AuthenticationProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA TCHAR username[MAX_PATH]; char passw[MAX_PATH]; if (!GetDlgItemText(hwndDlg, IDC_FEEDUSERNAME, username, SIZEOF(username))) { - MessageBox(hwndDlg, TranslateT("Enter your username"), TranslateT("Error"), MB_OK); + MessageBox(hwndDlg, TranslateT("Enter your username"), TranslateT("Error"), MB_OK | MB_ICONERROR); break; } if (!GetDlgItemTextA(hwndDlg, IDC_FEEDPASSWORD, passw, SIZEOF(passw))) { - MessageBox(hwndDlg, TranslateT("Enter your password"), TranslateT("Error"), MB_OK); + MessageBox(hwndDlg, TranslateT("Enter your password"), TranslateT("Error"), MB_OK | MB_ICONERROR); break; } - if (SelItem.hwndList) - { + if (SelItem.hwndList) { CheckDlgButton(SelItem.hwndList, IDC_USEAUTH, BST_CHECKED); EnableWindow(GetDlgItem(SelItem.hwndList, IDC_LOGIN), TRUE); EnableWindow(GetDlgItem(SelItem.hwndList, IDC_PASSWORD), TRUE); SetDlgItemText(SelItem.hwndList, IDC_LOGIN, username); SetDlgItemTextA(SelItem.hwndList, IDC_PASSWORD, passw); } - else if (SelItem.hContact) - { + else if (SelItem.hContact) { db_set_b(SelItem.hContact, MODULE, "UseAuth", 1); db_set_ts(SelItem.hContact, MODULE, "Login", username); CallService(MS_DB_CRYPT_ENCODESTRING, strlen(passw), (LPARAM)&passw); @@ -130,6 +125,5 @@ INT_PTR CALLBACK AuthenticationProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA } break; } - return FALSE; } \ No newline at end of file -- cgit v1.2.3