summaryrefslogtreecommitdiff
path: root/protocols/VKontakte/src
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/VKontakte/src')
-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);