From b5d1996ce850016641ea7d02dfda75cf02094132 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 27 Dec 2014 11:17:32 +0000 Subject: warning fix git-svn-id: http://svn.miranda-ng.org/main/trunk@11656 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/VKontakte/src/misc.cpp | 17 +++++++++-------- protocols/VKontakte/src/vk_feed.cpp | 8 ++++---- 2 files changed, 13 insertions(+), 12 deletions(-) (limited to 'protocols/VKontakte/src') 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); -- cgit v1.2.3