diff options
author | Tobias Weimer <wishmaster51@googlemail.com> | 2015-02-28 00:26:43 +0000 |
---|---|---|
committer | Tobias Weimer <wishmaster51@googlemail.com> | 2015-02-28 00:26:43 +0000 |
commit | 4410284da77786594d7009b6c515176de0d5a51e (patch) | |
tree | 949362dafe500e6ef07006ade5a9920d72d2c55e /src/modules/metacontacts | |
parent | 2095a324e774565a588425ed4a4986063e3c08fa (diff) |
Core:
-Some major and minor issues fixed
git-svn-id: http://svn.miranda-ng.org/main/trunk@12280 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/modules/metacontacts')
-rw-r--r-- | src/modules/metacontacts/meta_services.cpp | 4 | ||||
-rw-r--r-- | src/modules/metacontacts/meta_utils.cpp | 7 |
2 files changed, 7 insertions, 4 deletions
diff --git a/src/modules/metacontacts/meta_services.cpp b/src/modules/metacontacts/meta_services.cpp index 4452fda309..033afc4b25 100644 --- a/src/modules/metacontacts/meta_services.cpp +++ b/src/modules/metacontacts/meta_services.cpp @@ -245,7 +245,7 @@ INT_PTR Meta_SendMessage(WPARAM wParam,LPARAM lParam) tfap->hContact = ccs->hContact;
tfap->hEvent = hEvent;
tfap->id = 10;
- strcpy(tfap->msg, Translate("No online contacts found."));
+ strncpy(tfap->msg, Translate("No online contacts found."),SIZEOF(tfap->msg)-1);
DWORD dwThreadId;
CloseHandle(CreateThread(NULL, 0, sttFakeAckFail, tfap, 0, &dwThreadId));
@@ -275,6 +275,8 @@ INT_PTR Meta_SendMessage(WPARAM wParam,LPARAM lParam) int Meta_HandleACK(WPARAM, LPARAM lParam)
{
ACKDATA *ack = (ACKDATA*)lParam;
+ if (ack == NULL)
+ return 0;
DBCachedContact *cc = CheckMeta(ack->hContact);
if (cc == NULL)
return 0;
diff --git a/src/modules/metacontacts/meta_utils.cpp b/src/modules/metacontacts/meta_utils.cpp index 3fc3e26e72..6955973266 100644 --- a/src/modules/metacontacts/meta_utils.cpp +++ b/src/modules/metacontacts/meta_utils.cpp @@ -151,7 +151,7 @@ BOOL Meta_Assign(MCONTACT hSub, MCONTACT hMeta, BOOL set_as_default) db_set_ts(hMeta, META_PROTO, buffer, cli.pfnGetContactDisplayName(hSub, 0));
// Get the status
- WORD status = (!szProto) ? ID_STATUS_OFFLINE : db_get_w(hSub, szProto, "Status", ID_STATUS_OFFLINE);
+ WORD status = db_get_w(hSub, szProto, "Status", ID_STATUS_OFFLINE);
// write the status
mir_snprintf(buffer, SIZEOF(buffer), "Status%d", ccDest->nSubs);
@@ -284,7 +284,7 @@ MCONTACT Meta_GetMostOnlineSupporting(DBCachedContact *cc, int pflagnum, unsigne if (!szProto || CallProtoService(szProto, PS_GETSTATUS, 0, 0) < ID_STATUS_ONLINE) // szProto offline or connecting
continue;
- DWORD caps = szProto ? CallProtoService(szProto, PS_GETCAPS, pflagnum, 0) : 0;
+ DWORD caps = CallProtoService(szProto, PS_GETCAPS, pflagnum, 0);
if (szProto && (capability == -1 || (caps & capability) == capability)) {
int status = db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE);
if (status == ID_STATUS_ONLINE) {
@@ -531,7 +531,8 @@ void Meta_GetSubNick(MCONTACT hMeta, int i, CMString &tszDest) mir_snprintf(idStr, SIZEOF(idStr), "Login%d", i);
DBVARIANT dbv;
- db_get(hMeta, META_PROTO, idStr, &dbv);
+ if(db_get(hMeta, META_PROTO, idStr, &dbv))
+ return;
switch (dbv.type) {
case DBVT_ASCIIZ:
tszDest = dbv.pszVal;
|