summaryrefslogtreecommitdiff
path: root/protocols/SkypeClassic/src
diff options
context:
space:
mode:
authorTobias Weimer <wishmaster51@googlemail.com>2014-11-28 21:19:14 +0000
committerTobias Weimer <wishmaster51@googlemail.com>2014-11-28 21:19:14 +0000
commit6895d635acb37ba42e53ba95ca3eee2ddbbef24d (patch)
treef85a1d97784c4597099864119acb027b9a3f2dba /protocols/SkypeClassic/src
parent8ef06acf351fdb6034b6e13670d84bfd79161956 (diff)
Massive code cleanup and fixes for a lot of warnings reported in #837
git-svn-id: http://svn.miranda-ng.org/main/trunk@11136 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/SkypeClassic/src')
-rw-r--r--protocols/SkypeClassic/src/gchat.cpp9
-rw-r--r--protocols/SkypeClassic/src/skype.cpp9
2 files changed, 10 insertions, 8 deletions
diff --git a/protocols/SkypeClassic/src/gchat.cpp b/protocols/SkypeClassic/src/gchat.cpp
index a36884bc11..02046beeca 100644
--- a/protocols/SkypeClassic/src/gchat.cpp
+++ b/protocols/SkypeClassic/src/gchat.cpp
@@ -595,9 +595,8 @@ void SetChatTopic(const TCHAR *szChatId, TCHAR *szTopic, BOOL bSet)
int GCEventHook(WPARAM,LPARAM lParam) {
GCHOOK *gch = (GCHOOK*) lParam;
- gchat_contacts *gc = GetChat(gch->pDest->ptszID);
-
if(gch) {
+ gchat_contacts *gc = GetChat(gch->pDest->ptszID);
if (!_stricmp(gch->pDest->pszModule, SKYPE_PROTONAME)) {
switch (gch->pDest->iType) {
@@ -847,8 +846,10 @@ void GCExit(void)
{
DeleteCriticalSection (&m_GCMutex);
for (int i=0;i<chatcount;i++) {
- if (chats[i].szChatName) free(chats[i].szChatName);
- if (chats[i].mJoinedContacts) free(chats[i].mJoinedContacts);
+ if(chats[i]) {
+ free(chats[i].szChatName);
+ free(chats[i].mJoinedContacts);
+ }
}
if (chats) free (chats);
chats = NULL;
diff --git a/protocols/SkypeClassic/src/skype.cpp b/protocols/SkypeClassic/src/skype.cpp
index 76cb2801dc..d9f8502980 100644
--- a/protocols/SkypeClassic/src/skype.cpp
+++ b/protocols/SkypeClassic/src/skype.cpp
@@ -471,8 +471,8 @@ int SearchFriends(void) {
static void QueryUserWaitingAuthorization(char *pszNick, char *pszAuthRq)
{
- MCONTACT hContact;
- char *firstname = NULL, *lastname = NULL, *pCurBlob, *authmsg = NULL;
+ MCONTACT hContact = add_contact(pszNick, PALF_TEMPORARY);
+ char *lastname = NULL, *pCurBlob, *authmsg = NULL;
LOG(("Awaiting auth: %s", pszNick));
PROTORECVEVENT pre = { 0 };
@@ -481,14 +481,15 @@ static void QueryUserWaitingAuthorization(char *pszNick, char *pszAuthRq)
CCSDATA ccs = { 0 };
ccs.szProtoService = PSR_AUTH;
- ccs.hContact = hContact = add_contact(pszNick, PALF_TEMPORARY);
+ ccs.hContact = hContact;
ccs.wParam = 0;
ccs.lParam = (LPARAM)&pre;
/* blob is: */
//DWORD protocolSpecific MCONTACT hContact
//ASCIIZ nick, firstName, lastName, e-mail, requestReason
- if (firstname = SkypeGet("USER", pszNick, "FULLNAME")) {
+ char *firstname = SkypeGet("USER", pszNick, "FULLNAME");
+ if (firstname) {
if (lastname = strchr(firstname, ' ')) {
*lastname = 0;
lastname++;