summaryrefslogtreecommitdiff
path: root/protocols/VKontakte
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2014-12-27 11:17:32 +0000
committerGeorge Hazan <george.hazan@gmail.com>2014-12-27 11:17:32 +0000
commitb5d1996ce850016641ea7d02dfda75cf02094132 (patch)
tree40390f7281d6d0c862ddecf451c4e023c80851c1 /protocols/VKontakte
parent970c8cc95c7b01380b53d143f9b3b7de249e6fbe (diff)
warning fix
git-svn-id: http://svn.miranda-ng.org/main/trunk@11656 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/VKontakte')
-rw-r--r--protocols/VKontakte/src/misc.cpp17
-rw-r--r--protocols/VKontakte/src/vk_feed.cpp8
2 files changed, 13 insertions, 12 deletions
diff --git a/protocols/VKontakte/src/misc.cpp b/protocols/VKontakte/src/misc.cpp
index 051c34f929..511c5ce476 100644
--- a/protocols/VKontakte/src/misc.cpp
+++ b/protocols/VKontakte/src/misc.cpp
@@ -876,7 +876,7 @@ CMString CVkProto::SetBBCString(TCHAR *tszString, VKBBCType bbcType, TCHAR *tszA
{ vkbbcColor, bbcAdvanced, _T("[color=%s]%s[/color]") },
};
- TCHAR *ptszFormat;
+ TCHAR *ptszFormat = NULL;
for (int i = 0; i < SIZEOF(bbcItem); i++)
if (bbcItem[i].vkBBCType == bbcType && bbcItem[i].vkBBCSettings == m_iBBCForNews){
ptszFormat = bbcItem[i].ptszTempate;
@@ -884,13 +884,14 @@ CMString CVkProto::SetBBCString(TCHAR *tszString, VKBBCType bbcType, TCHAR *tszA
}
CMString res;
-
- if (bbcType == vkbbcUrl && m_iBBCForNews != bbcAdvanced)
- res.AppendFormat(ptszFormat, tszString ? tszString : _T(""), tszAddString ? tszAddString : _T(""));
- else if (m_iBBCForNews == bbcAdvanced && bbcType >= vkbbcUrl)
- res.AppendFormat(ptszFormat, tszAddString ? tszAddString : _T(""), tszString ? tszString : _T(""));
- else
- res.AppendFormat(ptszFormat, tszString ? tszString : _T(""));
+ if (ptszFormat != NULL) {
+ if (bbcType == vkbbcUrl && m_iBBCForNews != bbcAdvanced)
+ res.AppendFormat(ptszFormat, tszString ? tszString : _T(""), tszAddString ? tszAddString : _T(""));
+ else if (m_iBBCForNews == bbcAdvanced && bbcType >= vkbbcUrl)
+ res.AppendFormat(ptszFormat, tszAddString ? tszAddString : _T(""), tszString ? tszString : _T(""));
+ else
+ res.AppendFormat(ptszFormat, tszString ? tszString : _T(""));
+ }
return res;
} \ No newline at end of file
diff --git a/protocols/VKontakte/src/vk_feed.cpp b/protocols/VKontakte/src/vk_feed.cpp
index d392063d06..0488f5a4c1 100644
--- a/protocols/VKontakte/src/vk_feed.cpp
+++ b/protocols/VKontakte/src/vk_feed.cpp
@@ -48,9 +48,9 @@ void CVkProto::AddFeedSpecialUser()
}
void CVkProto::AddFeedEvent(CMString& tszBody, time_t tTime)
-{
- MCONTACT hContact = FindUser(VK_FEED_USER, true);
- ptrT ptszBody(mir_tstrdup(tszBody.GetBuffer()));
+{
+ MCONTACT hContact = FindUser(VK_FEED_USER, true);
+ ptrT ptszBody(mir_tstrdup(tszBody.GetBuffer()));
PROTORECVEVENT recv = { 0 };
recv.flags = PREF_TCHAR;
@@ -266,7 +266,7 @@ CMString CVkProto::GetVkFeedback(JSONNODE *pFeedback, VKObjType vkFeedbackType,
vkUser = GetVkUserInfo(iUserId, vkUsers);
CMString tszText = json_as_string(json_get(pFeedback, "text"));
- size_t iNameEnd = tszText.Find(_T("],")), iNameBeg = tszText.Find(_T("|"));
+ int iNameEnd = tszText.Find(_T("],")), iNameBeg = tszText.Find(_T("|"));
if (iNameEnd != -1 && iNameBeg != -1 && iNameBeg < iNameEnd){
CMString tszName = tszText.Mid(iNameBeg + 1, iNameEnd - iNameBeg - 1);
CMString tszBody = tszText.Mid(iNameEnd + 2);