From 4f0e30cdf56fbafdf955bbe8b93930bab9e39bd0 Mon Sep 17 00:00:00 2001 From: Rozhuk Ivan Date: Sun, 30 Nov 2014 18:33:56 +0000 Subject: Fix buf size for Get/Set text, open/save file name SMS: SIZE_T -> size_t MRA: small code cleanup git-svn-id: http://svn.miranda-ng.org/main/trunk@11175 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/MRA/src/Mra_functions.cpp | 4 ++-- protocols/MRA/src/Mra_options.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'protocols/MRA') diff --git a/protocols/MRA/src/Mra_functions.cpp b/protocols/MRA/src/Mra_functions.cpp index 3893bab587..a9af00ed8c 100644 --- a/protocols/MRA/src/Mra_functions.cpp +++ b/protocols/MRA/src/Mra_functions.cpp @@ -187,7 +187,7 @@ bool DB_GetStaticStringA(MCONTACT hContact, LPCSTR lpszModule, LPCSTR lpszValueN DBVARIANT dbv = { 0 }; if (db_get_ws(hContact, lpszModule, lpszValueName, &dbv) == 0) { - int dwRetBuffSizeLocal, dwReadedStringLen = lstrlenW(dbv.pwszVal); + size_t dwRetBuffSizeLocal, dwReadedStringLen = mir_wstrlen(dbv.pwszVal); if (lpszRetBuff && (dwRetBuffSize > dwReadedStringLen)) { dwRetBuffSizeLocal = WideCharToMultiByte(MRA_CODE_PAGE, 0, dbv.pwszVal, dwReadedStringLen, lpszRetBuff, dwRetBuffSize, NULL, NULL); (*((CHAR*)(lpszRetBuff + dwRetBuffSizeLocal))) = 0; @@ -1041,7 +1041,7 @@ INT_PTR CALLBACK SetXStatusDlgProc(HWND hWndDlg, UINT message, WPARAM wParam, LP if (dat) { // set our xStatus TCHAR szBuff[STATUS_TITLE_MAX + STATUS_DESC_MAX]; - DWORD dwBuffSize = GetDlgItemText(hWndDlg, IDC_XMSG, szBuff, STATUS_DESC_MAX + 1); + DWORD dwBuffSize = GetDlgItemText(hWndDlg, IDC_XMSG, szBuff, (STATUS_DESC_MAX + 1)); char szValueName[MAX_PATH]; mir_snprintf(szValueName, SIZEOF(szValueName), "XStatus%ldMsg", dat->dwXStatus); diff --git a/protocols/MRA/src/Mra_options.cpp b/protocols/MRA/src/Mra_options.cpp index d30e207549..9498b1ceca 100644 --- a/protocols/MRA/src/Mra_options.cpp +++ b/protocols/MRA/src/Mra_options.cpp @@ -42,7 +42,7 @@ INT_PTR CALLBACK DlgProcOptsAccount(HWND hWndDlg, UINT msg, WPARAM wParam, LPARA if (GetDlgItemText(hWndDlg, IDC_PASSWORD, szBuff, SIZEOF(szBuff))) { ppro->setTString("Password", szBuff); - SecureZeroMemory(szBuff, SIZEOF(szBuff)); + SecureZeroMemory(szBuff, sizeof(szBuff)); } return TRUE; } -- cgit v1.2.3