summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Weimer <wishmaster51@googlemail.com>2016-03-29 18:34:54 +0000
committerTobias Weimer <wishmaster51@googlemail.com>2016-03-29 18:34:54 +0000
commit7460f623d00f6119979688e5c4d788a8cdc0a478 (patch)
tree695d83cacb417d2e2675632c4ace252e1d21c9cd
parent91fa723b31fd3cd885d7f3dec8bc9d7e01d3bd41 (diff)
MRA: - minor fixes
git-svn-id: http://svn.miranda-ng.org/main/trunk@16562 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r--protocols/MRA/src/MraChat.cpp4
-rw-r--r--protocols/MRA/src/MraFilesQueue.cpp7
-rw-r--r--protocols/MRA/src/MraPopUp.cpp7
-rw-r--r--protocols/MRA/src/Mra_functions.cpp6
-rw-r--r--protocols/MRA/src/Mra_proto.cpp6
-rw-r--r--protocols/MRA/src/Sdk/InternetTime.h10
6 files changed, 23 insertions, 17 deletions
diff --git a/protocols/MRA/src/MraChat.cpp b/protocols/MRA/src/MraChat.cpp
index 2d1f2d3f6e..32a15914b3 100644
--- a/protocols/MRA/src/MraChat.cpp
+++ b/protocols/MRA/src/MraChat.cpp
@@ -55,8 +55,8 @@ INT_PTR CMraProto::MraChatSessionNew(MCONTACT hContact)
DWORD opcode = MULTICHAT_GET_MEMBERS;
CMStringA szEmail;
- mraGetStringA(hContact, "e-mail", szEmail);
- MraMessage(FALSE, NULL, 0, MESSAGE_FLAG_MULTICHAT, szEmail, _T(""), (LPBYTE)&opcode, sizeof(opcode));
+ if (mraGetStringA(hContact, "e-mail", szEmail))
+ MraMessage(FALSE, NULL, 0, MESSAGE_FLAG_MULTICHAT, szEmail, _T(""), (LPBYTE)&opcode, sizeof(opcode));
return 0;
}
}
diff --git a/protocols/MRA/src/MraFilesQueue.cpp b/protocols/MRA/src/MraFilesQueue.cpp
index 9ddef0f711..a69fbae0b6 100644
--- a/protocols/MRA/src/MraFilesQueue.cpp
+++ b/protocols/MRA/src/MraFilesQueue.cpp
@@ -385,8 +385,11 @@ bool CMraProto::MraFilesQueueHandCheck(HANDLE hConnection, MRA_FILES_QUEUE_ITEM
size_t dwBuffSize;
CMStringA szEmail, szEmailMy;
- mraGetStringA(NULL, "e-mail", szEmailMy); szEmailMy.MakeLower();
- mraGetStringA(dat->hContact, "e-mail", szEmail); szEmail.MakeLower();
+ if (!mraGetStringA(NULL, "e-mail", szEmailMy) || !mraGetStringA(dat->hContact, "e-mail", szEmail))
+ return false;
+
+ szEmailMy.MakeLower();
+ szEmail.MakeLower();
if (dat->bSending == FALSE) {
// receiving
diff --git a/protocols/MRA/src/MraPopUp.cpp b/protocols/MRA/src/MraPopUp.cpp
index 1665a6543c..48eb22e5bc 100644
--- a/protocols/MRA/src/MraPopUp.cpp
+++ b/protocols/MRA/src/MraPopUp.cpp
@@ -67,10 +67,8 @@ INT_PTR CALLBACK MraPopupDlgProcOpts(HWND hWndDlg, UINT msg, WPARAM wParam, LPAR
break;
case IDC_PREVIEW:
- {
- for (int i = 0; i < POPUPS_TYPES_COUNT; i++)
- ppro->MraPopupShowFromAgentW(i, 0, TranslateTS(lpcwszPopupsTypes[i]));
- }
+ for (int i = 0; i < POPUPS_TYPES_COUNT; i++)
+ ppro->MraPopupShowFromAgentW(i, 0, TranslateTS(lpcwszPopupsTypes[i]));
break;
case IDC_CHK_ENABLE:
@@ -84,6 +82,7 @@ INT_PTR CALLBACK MraPopupDlgProcOpts(HWND hWndDlg, UINT msg, WPARAM wParam, LPAR
EnableWindow(GetDlgItem(hWndDlg, IDC_POPUP_TEXTCOLOR), (bEnabled && bUseWinColors == FALSE));
EnableWindow(GetDlgItem(hWndDlg, IDC_POPUP_TIMEOUT), bEnabled);
}
+ // fall through
default:
if ((LOWORD(wParam) == IDC_POPUP_TIMEOUT) && (HIWORD(wParam) != EN_CHANGE || (HWND)lParam != GetFocus()))
return FALSE;
diff --git a/protocols/MRA/src/Mra_functions.cpp b/protocols/MRA/src/Mra_functions.cpp
index 26b6ddd8ae..06e1890847 100644
--- a/protocols/MRA/src/Mra_functions.cpp
+++ b/protocols/MRA/src/Mra_functions.cpp
@@ -115,7 +115,8 @@ DWORD MraAddrListGetFromBuff(const CMStringA &szAddresses, MRA_ADDR_LIST *pmalAd
while (TRUE) {
LPSTR lpszEndItem = strchr(lpszCurrentItem, ';');
- if (lpszEndItem == NULL) lpszEndItem = buf + szAddresses.GetLength();
+ if (lpszEndItem == NULL)
+ lpszEndItem = buf + szAddresses.GetLength();
if (!lpszEndItem)
break;
@@ -414,7 +415,8 @@ DWORD CMraProto::GetContactBasicInfoW(MCONTACT hContact, DWORD *pdwID, DWORD *pd
if (pdwContactFlag)
*pdwContactFlag = GetContactFlags(hContact);
if (szEmail)
- mraGetStringA(hContact, "e-mail", *szEmail);
+ if (!mraGetStringA(hContact, "e-mail", *szEmail))
+ return 0;
if (wszNick)
DB_GetStringW(hContact, "CList", "MyHandle", *wszNick);
diff --git a/protocols/MRA/src/Mra_proto.cpp b/protocols/MRA/src/Mra_proto.cpp
index caeb8819ae..83c0d89f49 100644
--- a/protocols/MRA/src/Mra_proto.cpp
+++ b/protocols/MRA/src/Mra_proto.cpp
@@ -13,7 +13,8 @@ DWORD CMraProto::StartConnect()
return 0;
CMStringA szEmail;
- mraGetStringA(NULL, "e-mail", szEmail);
+ if (!mraGetStringA(NULL, "e-mail", szEmail))
+ return 0;
CMStringA szPass;
if (szEmail.GetLength() <= 5)
@@ -1647,7 +1648,8 @@ DWORD CMraProto::MraRecvCommand_Message(DWORD dwTime, DWORD dwFlags, CMStringA &
InternetTimeGetCurrentTime(&itTime);
CMStringA szTime = InternetTimeGetString(&itTime);
CMStringA szPhone = CopyNumber(plpsFrom), szEmail;
- mraGetStringA(NULL, "e-mail", szEmail);
+ if (!mraGetStringA(NULL, "e-mail", szEmail))
+ return 0;
CMStringW wszMessageXMLEncoded = EncodeXML(wszMessage);
ptrA lpszMessageUTF(mir_utf8encodeW(wszMessageXMLEncoded));
diff --git a/protocols/MRA/src/Sdk/InternetTime.h b/protocols/MRA/src/Sdk/InternetTime.h
index d1bd7e50aa..7ec927e738 100644
--- a/protocols/MRA/src/Sdk/InternetTime.h
+++ b/protocols/MRA/src/Sdk/InternetTime.h
@@ -172,16 +172,16 @@ __inline DWORD InternetTimeGetTime(const CMStringA &lpszTime, INTERNET_TIME &pit
// = Thu, 21 May 1998 05:33:29 -0700 =
char sztmBuff[4096];
LPSTR lpszCurPos=sztmBuff,lpszTemp;
- size_t i,dwCurSize=4096,dwTemp;
+ size_t dwCurSize=4096,dwTemp;
memset(&pitTime, 0, sizeof(INTERNET_TIME));
WSP2SP(lpszTime, lpszTime.GetLength(), lpszCurPos, &dwCurSize);
if (dwCurSize > 3) { // день недели
if (lpszCurPos[3] == ',') {
- for (i=0; i < 8; i++) {
+ for (unsigned short i=0; i < 7; i++) {
if ( !_memicmp(lpcszenmDayOfWeakEnum[i], lpszCurPos, 3)) {
- pitTime.stTime.wDayOfWeek=(unsigned short)i;
+ pitTime.stTime.wDayOfWeek = i;
break;
}
}
@@ -202,9 +202,9 @@ __inline DWORD InternetTimeGetTime(const CMStringA &lpszTime, INTERNET_TIME &pit
if (dwCurSize > 3) { // месяц
SkeepSPWSP(lpszCurPos,dwCurSize,&lpszCurPos,&dwCurSize);
- for (i=1; i < 14; i++)
+ for (unsigned short i=1; i < 13; i++)
if ( !_memicmp(lpcszenmMonthEnum[i], lpszCurPos, 3)) {
- pitTime.stTime.wMonth=(unsigned short)i;
+ pitTime.stTime.wMonth = i;
break;
}