From e2c2a1f5a84c6c9b705dc85c6a2dd1f97edd57e4 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 22 May 2015 16:04:17 +0000 Subject: T2Utf - handy replacement for ptrA git-svn-id: http://svn.miranda-ng.org/main/trunk@13758 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Db3x_mmap/src/dbcrypt.cpp | 2 +- plugins/Db3x_mmap/src/ui.cpp | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) (limited to 'plugins/Db3x_mmap/src') diff --git a/plugins/Db3x_mmap/src/dbcrypt.cpp b/plugins/Db3x_mmap/src/dbcrypt.cpp index fdff3ce5ec..f80dd8f6e2 100644 --- a/plugins/Db3x_mmap/src/dbcrypt.cpp +++ b/plugins/Db3x_mmap/src/dbcrypt.cpp @@ -232,7 +232,7 @@ void CDb3Mmap::SetPassword(LPCTSTR ptszPassword) } else { m_bUsesPassword = true; - m_crypto->setPassword(ptrA(mir_utf8encodeT(ptszPassword))); + m_crypto->setPassword(T2Utf(ptszPassword)); } UpdateMenuItem(); } diff --git a/plugins/Db3x_mmap/src/ui.cpp b/plugins/Db3x_mmap/src/ui.cpp index 4a6cb3d543..ec5fcb4184 100644 --- a/plugins/Db3x_mmap/src/ui.cpp +++ b/plugins/Db3x_mmap/src/ui.cpp @@ -125,7 +125,7 @@ bool CDb3Mmap::EnterPassword(const BYTE *pKey, const size_t keyLen) if (IDOK != DialogBoxParam(g_hInst, MAKEINTRESOURCE(IDD_LOGIN), 0, sttEnterPassword, (LPARAM)¶m)) return false; - m_crypto->setPassword(ptrA(mir_utf8encodeT(param.newPass))); + m_crypto->setPassword(T2Utf(param.newPass)); if (m_crypto->setKey(pKey, keyLen)) { m_bUsesPassword = true; SecureZeroMemory(¶m, sizeof(param)); @@ -143,8 +143,7 @@ static bool CheckOldPassword(HWND hwndDlg, CDb3Mmap *db) if (db->usesPassword()) { TCHAR buf[100]; GetDlgItemText(hwndDlg, IDC_OLDPASS, buf, SIZEOF(buf)); - ptrA oldPass(mir_utf8encodeT(buf)); - if (!db->m_crypto->checkPassword(oldPass)) { + if (!db->m_crypto->checkPassword(T2Utf(buf))) { SetDlgItemText(hwndDlg, IDC_HEADERBAR, TranslateT("Wrong old password entered!")); return false; } -- cgit v1.2.3