From 4cf73d23162c2e30005b4b52fd657c6e373dafc8 Mon Sep 17 00:00:00 2001 From: kichik Date: Wed, 11 Apr 2007 21:37:08 +0000 Subject: [PATCH] replaced WCStrLen with winchar_strlen git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@5058 212acab6-be3b-0410-9dea-997c60f758d6 --- Source/script.cpp | 2 +- Source/util.cpp | 2 +- Source/util.h | 3 --- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/Source/script.cpp b/Source/script.cpp index 3a8c0633..f1c37380 100644 --- a/Source/script.cpp +++ b/Source/script.cpp @@ -4735,7 +4735,7 @@ int CEXEBuild::doCommand(int which_token, LineParser &line) { // get VS_FIXEDFILEINFO from VS_VERSIONINFO WCHAR *szKey = (WCHAR *)(ver + sizeof(WORD) * 3); - int len = WCStrLen(szKey) * sizeof(WCHAR) + sizeof(WORD) * 3; + int len = (winchar_strlen(szKey) + 1) * sizeof(WCHAR) + sizeof(WORD) * 3; len = (len + 3) & ~3; // align on DWORD boundry VS_FIXEDFILEINFO *verinfo = (VS_FIXEDFILEINFO *)(ver + len); if (versize > len && verinfo->dwSignature == VS_FFI_SIGNATURE) diff --git a/Source/util.cpp b/Source/util.cpp index 23f7cc45..830370cd 100644 --- a/Source/util.cpp +++ b/Source/util.cpp @@ -451,7 +451,7 @@ int WideCharToMultiByte(UINT CodePage, DWORD dwFlags, LPCWSTR lpWideCharStr, } if (cchWideChar < 0) { - cchWideChar = (int) WCStrLen(lpWideCharStr); // including null char + cchWideChar = (int) winchar_strlen(lpWideCharStr) + 1; } if (cbMultiByte == 0) { diff --git a/Source/util.h b/Source/util.h index 550d60f3..82b5aeb9 100644 --- a/Source/util.h +++ b/Source/util.h @@ -46,9 +46,6 @@ unsigned char* generate_uninstall_icon_data(const char* filename, size_t &size); int generate_unicons_offsets(unsigned char* exeHeader, size_t exeHeaderSize, unsigned char* uninstIconData); #endif//NSIS_CONFIG_UNINSTALL_SUPPORT -// returns the number of WCHARs in str including null charcter -size_t WCStrLen(const WCHAR* szwStr); - size_t my_strftime(char *s, size_t max, const char *fmt, const struct tm *tm); std::string get_full_path(const std::string& path);