diff options
author | Daniel Wilhelm <daniel@wili.li> | 2015-10-02 14:54:34 +0200 |
---|---|---|
committer | Daniel Wilhelm <daniel@wili.li> | 2015-10-02 14:54:34 +0200 |
commit | 96e20826f358a32e38c3f052243375982543c05b (patch) | |
tree | 691efa86265fbb35cc60a1ce816423bb2a41f17b /zen/long_path_prefix.h | |
parent | 6.13 (diff) | |
download | FreeFileSync-96e20826f358a32e38c3f052243375982543c05b.tar.gz FreeFileSync-96e20826f358a32e38c3f052243375982543c05b.tar.bz2 FreeFileSync-96e20826f358a32e38c3f052243375982543c05b.zip |
6.14
Diffstat (limited to 'zen/long_path_prefix.h')
-rw-r--r-- | zen/long_path_prefix.h | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/zen/long_path_prefix.h b/zen/long_path_prefix.h index d2289330..19b838ef 100644 --- a/zen/long_path_prefix.h +++ b/zen/long_path_prefix.h @@ -47,15 +47,6 @@ As used by GetModuleFileNameEx() and symlinks (FSCTL_GET_REPARSE_POINT): - - - - - - - - - //################## implementation ################## //there are two flavors of long path prefix: one for UNC paths, one for regular paths @@ -128,11 +119,11 @@ Zstring zen::ntPathToWin32Path(const Zstring& path) //noexcept if (bufSize > 0) { std::vector<wchar_t> buf(bufSize); - DWORD charsWritten = ::GetEnvironmentVariable(L"SystemRoot", //_In_opt_ LPCTSTR lpName, + const DWORD charsWritten = ::GetEnvironmentVariable(L"SystemRoot", //_In_opt_ LPCTSTR lpName, &buf[0], //_Out_opt_ LPTSTR lpBuffer, bufSize); //_In_ DWORD nSize - if (charsWritten != 0 && charsWritten < bufSize) + if (0 < charsWritten && charsWritten < bufSize) return replaceCpy(path, L"\\SystemRoot\\", appendSeparator(Zstring(&buf[0], charsWritten)), false); } } |