summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-06-17 20:46:57 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-06-17 20:46:57 +0000
commit46c77425ebf39fe8221a3cc3d026fbd611be9ca4 (patch)
treeefcd71050ee805694f20a007e370d7ec2755d9bc /src
parenta75ce08f5ea46237b73e5052a956829c0e272678 (diff)
more secure dll cleaner
git-svn-id: http://svn.miranda-ng.org/main/trunk@14239 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src')
-rw-r--r--src/miranda32/src/checker.cpp8
-rw-r--r--src/miranda32/src/miranda.cpp5
-rw-r--r--src/miranda32/src/stdafx.h2
3 files changed, 5 insertions, 10 deletions
diff --git a/src/miranda32/src/checker.cpp b/src/miranda32/src/checker.cpp
index c6371a20f1..0d2ce78369 100644
--- a/src/miranda32/src/checker.cpp
+++ b/src/miranda32/src/checker.cpp
@@ -196,14 +196,10 @@ bool TryDeleteFile(const TCHAR *ptszFileName)
/////////////////////////////////////////////////////////////////////////////////////////
-bool CheckDlls(const TCHAR *ptszPath)
+bool CheckDlls()
{
- // ptszPath - slash-terminated string
- TCHAR tszSearchPath[MAX_PATH];
- _sntprintf(tszSearchPath, _countof(tszSearchPath), _T("*.dll"), ptszPath);
-
WIN32_FIND_DATA findData;
- HANDLE hSearch = FindFirstFile(tszSearchPath, &findData);
+ HANDLE hSearch = FindFirstFile(_T("*.dll"), &findData);
if (hSearch == INVALID_HANDLE_VALUE) // no dlls? why bother
return true;
diff --git a/src/miranda32/src/miranda.cpp b/src/miranda32/src/miranda.cpp
index 0f09be31b2..c5751aca4f 100644
--- a/src/miranda32/src/miranda.cpp
+++ b/src/miranda32/src/miranda.cpp
@@ -34,14 +34,13 @@ int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE, LPTSTR cmdLine, int)
return 4;
// if current dir isn't set
- *p = 0;
+ p[1] = 0;
SetCurrentDirectory(tszPath);
// all dlls must be moved to libs
- if (!CheckDlls(tszPath))
+ if (!CheckDlls())
return 3;
- *p = '\\'; p[1] = 0;
_tcsncat(tszPath, _T("libs"), _TRUNCATE);
DWORD cbPath = (DWORD)_tcslen(tszPath);
diff --git a/src/miranda32/src/stdafx.h b/src/miranda32/src/stdafx.h
index 043f60eda2..df679649e0 100644
--- a/src/miranda32/src/stdafx.h
+++ b/src/miranda32/src/stdafx.h
@@ -26,4 +26,4 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <tchar.h>
-bool CheckDlls(const TCHAR *ptszPath);
+bool CheckDlls(void);