From 50524f7e1cecb90a522a9e0eac7c45df38c132c6 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 9 Nov 2014 18:26:16 +0000 Subject: code cleaning git-svn-id: http://svn.miranda-ng.org/main/trunk@10939 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/modules/database/dbini.cpp | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/src/modules/database/dbini.cpp b/src/modules/database/dbini.cpp index 5feeda7b35..d26209a8ac 100644 --- a/src/modules/database/dbini.cpp +++ b/src/modules/database/dbini.cpp @@ -407,15 +407,14 @@ static void DoAutoExec(void) { TCHAR szUse[7], szIniPath[MAX_PATH], szFindPath[MAX_PATH]; TCHAR buf[2048], szSecurity[11], szOverrideSecurityFilename[MAX_PATH], szOnCreateFilename[MAX_PATH]; - char *szSafeSections, *szUnsafeSections; int secur; GetPrivateProfileString(_T("AutoExec"), _T("Use"), _T("prompt"), szUse, SIZEOF(szUse), mirandabootini); if (!lstrcmpi(szUse, _T("no"))) return; GetPrivateProfileString(_T("AutoExec"), _T("Safe"), _T("CLC Icons CLUI CList SkinSounds"), buf, SIZEOF(buf), mirandabootini); - szSafeSections = mir_t2a(buf); + ptrA szSafeSections(mir_t2a(buf)); GetPrivateProfileString(_T("AutoExec"), _T("Unsafe"), _T("AIM Facebook GG ICQ IRC JABBER MRA MSN SKYPE Tlen TWITTER VKontakte XFire"), buf, SIZEOF(buf), mirandabootini); - szUnsafeSections = mir_t2a(buf); + ptrA szUnsafeSections(mir_t2a(buf)); GetPrivateProfileString(_T("AutoExec"), _T("Warn"), _T("notsafe"), szSecurity, SIZEOF(szSecurity), mirandabootini); if (!lstrcmpi(szSecurity, _T("none"))) secur = 0; else if (!lstrcmpi(szSecurity, _T("notsafe"))) secur = 1; @@ -434,15 +433,14 @@ static void DoAutoExec(void) WIN32_FIND_DATA fd; HANDLE hFind = FindFirstFile(szFindPath, &fd); - if (hFind == INVALID_HANDLE_VALUE) { - mir_free(szSafeSections); - mir_free(szUnsafeSections); + if (hFind == INVALID_HANDLE_VALUE) return; - } TCHAR *str2 = _tcsrchr(szFindPath, '\\'); - if (str2 == NULL) szFindPath[0] = 0; - else str2[1] = 0; + if (str2 == NULL) + szFindPath[0] = 0; + else + str2[1] = 0; do { bool secFN = lstrcmpi(fd.cFileName, szOverrideSecurityFilename) == 0; @@ -472,8 +470,7 @@ static void DoAutoExec(void) SHFileOperation(&shfo); } else if (!lstrcmpi(szOnCompletion, _T("rename"))) { - TCHAR szRenamePrefix[MAX_PATH]; - TCHAR szNewPath[MAX_PATH]; + TCHAR szRenamePrefix[MAX_PATH], szNewPath[MAX_PATH]; GetPrivateProfileString(_T("AutoExec"), _T("RenamePrefix"), _T("done_"), szRenamePrefix, SIZEOF(szRenamePrefix), mirandabootini); lstrcpy(szNewPath, szFindPath); lstrcat(szNewPath, szRenamePrefix); @@ -487,8 +484,6 @@ static void DoAutoExec(void) while (FindNextFile(hFind, &fd)); FindClose(hFind); - mir_free(szSafeSections); - mir_free(szUnsafeSections); } static INT_PTR CheckIniImportNow(WPARAM, LPARAM) -- cgit v1.2.3