summaryrefslogtreecommitdiff
path: root/protocols/VKontakte
diff options
context:
space:
mode:
authorSergey Bolhovskoy <elzorfox@ya.ru>2015-02-09 18:52:39 +0000
committerSergey Bolhovskoy <elzorfox@ya.ru>2015-02-09 18:52:39 +0000
commitd9b9005aa856b7a2e4747bb3ced41920e7622db5 (patch)
tree27e5b8f8cc92f25141bca9276d49115928c6fbea /protocols/VKontakte
parentc2c68d35470d448194aecf3cc4bedee5b1487f5a (diff)
VKontakte: remove logically dead code (detect by coverity)
git-svn-id: http://svn.miranda-ng.org/main/trunk@12072 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/VKontakte')
-rw-r--r--protocols/VKontakte/src/misc.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/protocols/VKontakte/src/misc.cpp b/protocols/VKontakte/src/misc.cpp
index e8b5682b29..f1b78ad7aa 100644
--- a/protocols/VKontakte/src/misc.cpp
+++ b/protocols/VKontakte/src/misc.cpp
@@ -925,6 +925,11 @@ CMString CVkProto::GetAttachmentDescr(JSONNODE *pAttachments, BBCSupport iBBC)
{
debugLogA("CVkProto::GetAttachmentDescr");
CMString res;
+ if (pAttachments == NULL) {
+ debugLogA("CVkProto::GetAttachmentDescr pAttachments == NULL");
+ return res;
+ }
+
res += SetBBCString(TranslateT("Attachments:"), iBBC, vkbbcB);
res.AppendChar('\n');
JSONNODE *pAttach;
@@ -1060,18 +1065,13 @@ CMString CVkProto::GetFwdMessages(JSONNODE *pMessages, BBCSupport iBBC)
{
CMString res;
debugLogA("CVkProto::GetFwdMessages");
- if (pMessages == NULL){
+ if (pMessages == NULL) {
debugLogA("CVkProto::GetFwdMessages pMessages == NULL");
return res;
}
JSONNODE *pMsg;
for (int i = 0; (pMsg = json_at(pMessages, i)) != NULL; i++) {
- if (pMsg == NULL) {
- debugLogA("CVkProto::GetFwdMessages pMsg == NULL");
- break;
- }
-
int uid = json_as_int(json_get(pMsg, "user_id"));
MCONTACT hContact = FindUser(uid);
CMString tszNick;
@@ -1092,7 +1092,7 @@ CMString CVkProto::GetFwdMessages(JSONNODE *pMessages, BBCSupport iBBC)
CMString tszBody = json_as_CMString(json_get(pMsg, "body"));
JSONNODE *pFwdMessages = json_get(pMsg, "fwd_messages");
- if (pFwdMessages != NULL){
+ if (pFwdMessages != NULL) {
CMString tszFwdMessages = GetFwdMessages(pFwdMessages, m_iBBCForAttachments);
if (!tszBody.IsEmpty())
tszFwdMessages = _T("\n") + tszFwdMessages;
@@ -1100,7 +1100,7 @@ CMString CVkProto::GetFwdMessages(JSONNODE *pMessages, BBCSupport iBBC)
}
JSONNODE *pAttachments = json_get(pMsg, "attachments");
- if (pAttachments != NULL){
+ if (pAttachments != NULL) {
CMString tszAttachmentDescr = GetAttachmentDescr(pAttachments, m_iBBCForAttachments);
if (!tszBody.IsEmpty())
tszAttachmentDescr = _T("\n") + tszAttachmentDescr;
@@ -1120,5 +1120,6 @@ CMString CVkProto::GetFwdMessages(JSONNODE *pMessages, BBCSupport iBBC)
res.AppendChar(_T('\n'));
res += tszMes;
}
+
return res;
} \ No newline at end of file