From 8f363ee967527cf9b91e909cd32684a4ac5a3ce9 Mon Sep 17 00:00:00 2001 From: "(no author)" <(no author)@4f64403b-2f21-0410-a795-97e2b3489a10> Date: Tue, 6 Apr 2010 03:23:02 +0000 Subject: More optimizations git-svn-id: https://server.scottellis.com.au/svn/mim_plugs@500 4f64403b-2f21-0410-a795-97e2b3489a10 --- updater/utils.cpp | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) (limited to 'updater/utils.cpp') diff --git a/updater/utils.cpp b/updater/utils.cpp index e1ffdea..6e1afad 100644 --- a/updater/utils.cpp +++ b/updater/utils.cpp @@ -118,9 +118,8 @@ bool DeleteNonDlls(const TCHAR *folder) TCHAR szFilesPath[MAX_PATH]; { - char buff[200], *ts; - mir_snprintf(buff, SIZEOF(buff), "Deleting non-dlls in %s", (ts = mir_t2a(folder))); - mir_free(ts); + TCHAR buff[200]; + mir_sntprintf(buff, SIZEOF(buff), _T("Deleting non-dlls in %s"), folder); NLog(buff); } @@ -140,9 +139,8 @@ bool DeleteNonDlls(const TCHAR *folder) if (_tcsstr(findData.cFileName, _T(".dll")) == 0) { { - char buff[200], *ts; - mir_snprintf(buff, SIZEOF(buff), "Deleting %s", (ts = mir_t2a(folder))); - mir_free(ts); + TCHAR buff[200]; + mir_sntprintf(buff, SIZEOF(buff), _T("Deleting %s"), folder); NLog(buff); } DeleteFile(szFilesPath); @@ -155,3 +153,17 @@ bool DeleteNonDlls(const TCHAR *folder) return true; } + +void NLog(char *msg) +{ + CallService(MS_NETLIB_LOG, (WPARAM)hNetlibUser, (LPARAM)msg); +} + +#ifdef _UNICODE +void NLog(wchar_t *msg) +{ + char* a = mir_u2a(msg); + CallService(MS_NETLIB_LOG, (WPARAM)hNetlibUser, (LPARAM)a); + mir_free(a); +} +#endif \ No newline at end of file -- cgit v1.2.3