From 9f8f69354030860c05e3c89b8050723a135b74f4 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 21 Sep 2013 19:09:01 +0000 Subject: fix for msn avatars git-svn-id: http://svn.miranda-ng.org/main/trunk@6168 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/MSN/src/msn_misc.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'protocols/MSN/src/msn_misc.cpp') diff --git a/protocols/MSN/src/msn_misc.cpp b/protocols/MSN/src/msn_misc.cpp index 94ee971d1f..072cb70951 100644 --- a/protocols/MSN/src/msn_misc.cpp +++ b/protocols/MSN/src/msn_misc.cpp @@ -204,11 +204,10 @@ void CMsnProto::MSN_GetAvatarFileName(HANDLE hContact, TCHAR* pszDest, size_t cb InitCustomFolders(); TCHAR* path = (TCHAR*)alloca(cbLen * sizeof(TCHAR)); - if (hMSNAvatarsFolder == NULL || FoldersGetCustomPathT(hMSNAvatarsFolder, path, (int)cbLen, _T(""))) - { + if (hMSNAvatarsFolder == NULL || FoldersGetCustomPathT(hMSNAvatarsFolder, path, (int)cbLen, _T(""))) { TCHAR *tmpPath = Utils_ReplaceVarsT(_T("%miranda_userdata%")); TCHAR *sztModuleName = mir_a2t(m_szModuleName); - tPathLen = mir_sntprintf(pszDest, cbLen, _T("%s\\Avatars\\%s"), tmpPath, sztModuleName); + tPathLen = mir_sntprintf(pszDest, cbLen, _T("%s\\AvatarCache\\%s"), tmpPath, sztModuleName); mir_free(sztModuleName); mir_free(tmpPath); } @@ -265,7 +264,10 @@ void CMsnProto::MSN_GetAvatarFileName(HANDLE hContact, TCHAR* pszDest, size_t cb if (!found) pszDest[0] = 0; } - else mir_sntprintf(pszDest + tPathLen, cbLen - tPathLen, ext); + else { + tPathLen--; + mir_sntprintf(pszDest + tPathLen, cbLen - tPathLen, ext); + } } int CMsnProto::MSN_SetMyAvatar(const TCHAR* sztFname, void* pData, size_t cbLen) -- cgit v1.2.3