Skip to content
Snippets Groups Projects
Commit fce5e4d3 authored by Steve Lhomme's avatar Steve Lhomme Committed by Alaric Senat
Browse files

LockFile: don't use char string if they are NULL

parent 19b3e069
No related branches found
No related tags found
No related merge requests found
...@@ -50,6 +50,9 @@ std::unique_ptr<LockFile> LockFile::lock( const std::string& mlFolderPath ) ...@@ -50,6 +50,9 @@ std::unique_ptr<LockFile> LockFile::lock( const std::string& mlFolderPath )
Handle handle; Handle handle;
#ifdef _WIN32 #ifdef _WIN32
auto wide = charset::ToWide( lockFile.c_str() ); auto wide = charset::ToWide( lockFile.c_str() );
if ( !wide )
handle = INVALID_HANDLE_VALUE;
else
# if _WIN32_WINNT >= 0x0602 /* _WIN32_WINNT_WIN8 */ # if _WIN32_WINNT >= 0x0602 /* _WIN32_WINNT_WIN8 */
handle = CreateFile2(wide.get(), GENERIC_WRITE, 0, CREATE_ALWAYS, NULL); handle = CreateFile2(wide.get(), GENERIC_WRITE, 0, CREATE_ALWAYS, NULL);
# else # else
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment