summaryrefslogtreecommitdiff
path: root/protocols/Sametime
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/Sametime')
-rw-r--r--protocols/Sametime/src/files.cpp6
-rw-r--r--protocols/Sametime/src/sametime.cpp6
2 files changed, 6 insertions, 6 deletions
diff --git a/protocols/Sametime/src/files.cpp b/protocols/Sametime/src/files.cpp
index cfbc52d824..29f3a0a077 100644
--- a/protocols/Sametime/src/files.cpp
+++ b/protocols/Sametime/src/files.cpp
@@ -358,7 +358,7 @@ HANDLE CSametimeProto::SendFilesToUser(MCONTACT hContact, PROTOCHAR** files, con
HANDLE CSametimeProto::AcceptFileTransfer(MCONTACT hContact, HANDLE hFt, char* save_path)
{
- mwFileTransfer* ft = (mwFileTransfer*)(hFt);
+ mwFileTransfer* ft = (mwFileTransfer*)hFt;
CSametimeProto* proto = getProtoFromMwFileTransfer(ft);
debugLog(_T("CSametimeProto::AcceptFileTransfer() start"));
@@ -366,7 +366,7 @@ HANDLE CSametimeProto::AcceptFileTransfer(MCONTACT hContact, HANDLE hFt, char* s
memset((void*)ftcd, 0, sizeof(FileTransferClientData));
ftcd->ft = ft;
ftcd->sending = false;
- ftcd->hFt = (HANDLE)ft;
+ ftcd->hFt = hFt;
if (save_path) // save path
ftcd->save_path = _strdup(save_path);
@@ -420,7 +420,7 @@ void CSametimeProto::CancelFileTransfer(HANDLE hFt)
FileTransferClientData* ftcd = (FileTransferClientData*)mwFileTransfer_getClientData(ft);
if (ftcd) {
- while (mwFileTransfer_isDone(ftcd->ft) && ftcd)
+ while (ftcd && mwFileTransfer_isDone(ftcd->ft))
ftcd = ftcd->next;
if (ftcd) mwFileTransfer_cancel(ftcd->ft);
diff --git a/protocols/Sametime/src/sametime.cpp b/protocols/Sametime/src/sametime.cpp
index b0b50a6e52..f8966db031 100644
--- a/protocols/Sametime/src/sametime.cpp
+++ b/protocols/Sametime/src/sametime.cpp
@@ -174,12 +174,12 @@ void __cdecl sttRecvAwayThread(void *param)
int CSametimeProto::OnWindowEvent(WPARAM, LPARAM lParam)
{
- MessageWindowEventData* mwed = (MessageWindowEventData*)lParam;
+ MessageWindowEventData *mwed = (MessageWindowEventData*)lParam;
- if (db_get_b(mwed->hContact, m_szModuleName, "ChatRoom", 0))
+ if ((mwed == NULL) || db_get_b(mwed->hContact, m_szModuleName, "ChatRoom", 0))
return 0;
- if (mwed && (mwed->uType == MSG_WINDOW_EVT_CLOSING || mwed->uType == MSG_WINDOW_EVT_CLOSE))
+ if ((mwed->uType == MSG_WINDOW_EVT_CLOSING) || (mwed->uType == MSG_WINDOW_EVT_CLOSE))
CloseIm(mwed->hContact);
return 0;