From 976508f30d0579e05d8ccd53be903b3cda89f508 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 18 Mar 2013 11:51:38 +0000 Subject: various memory allocation problems git-svn-id: http://svn.miranda-ng.org/main/trunk@4090 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Msg_Export/src/utils.cpp | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'plugins/Msg_Export/src/utils.cpp') diff --git a/plugins/Msg_Export/src/utils.cpp b/plugins/Msg_Export/src/utils.cpp index b2339b8ec6..a2accf6a7d 100755 --- a/plugins/Msg_Export/src/utils.cpp +++ b/plugins/Msg_Export/src/utils.cpp @@ -540,16 +540,12 @@ bool bWriteHexToFile( HANDLE hFile, void * pData, int nSize ) // Developer : KN ///////////////////////////////////////////////////////////////////// - bool bReadMirandaDirAndPath() { - TCHAR szDBPath[MAX_PATH]; - char tmp[MAX_PATH]; - TCHAR *tmp2; - _tcscpy( szDBPath, pszDbPathError ); - PathToAbsolute("miranda32.exe", tmp); - tmp2 = mir_utf8decodeT(tmp); - sMirandaPath = tmp2; + TCHAR szDBPath[MAX_PATH], tmp[MAX_PATH]; + _tcscpy(szDBPath, pszDbPathError); + PathToAbsoluteT( _T("miranda32.exe"), tmp); + sMirandaPath = tmp; sMirandaPath.erase(sMirandaPath.find_last_of(_T("\\"))); CallService(MS_DB_GETPROFILEPATHT, (WPARAM)MAX_PATH - 1, (LPARAM)szDBPath); sDBPath = szDBPath; @@ -577,8 +573,7 @@ void ReplaceDBPath( tstring &sRet ) ReplaceAll( sRet, _T("%dbpath%"), sDBPath ); // Try to firure out if it is a relative path ( ..\..\MsgExport\ ) if (sRet.size() <= 2 || ! ( sRet[1] == ':' || - ( sRet[0] == '\\' && sRet[1] == '\\')) - ) + ( sRet[0] == '\\' && sRet[1] == '\\'))) { // Relative path // we will prepend the mirande exe path to avoid problems -- cgit v1.2.3