summaryrefslogtreecommitdiff
path: root/core/fxcrt/fxcrt_windows.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/fxcrt/fxcrt_windows.cpp')
-rw-r--r--core/fxcrt/fxcrt_windows.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/core/fxcrt/fxcrt_windows.cpp b/core/fxcrt/fxcrt_windows.cpp
index 6230c74eb7..1a2a36735e 100644
--- a/core/fxcrt/fxcrt_windows.cpp
+++ b/core/fxcrt/fxcrt_windows.cpp
@@ -57,8 +57,8 @@ bool CFXCRT_FileAccess_Win64::Open(const CFX_ByteStringC& fileName,
uint32_t dwAccess, dwShare, dwCreation;
FXCRT_Windows_GetFileMode(dwMode, dwAccess, dwShare, dwCreation);
- m_hFile = ::CreateFileA(fileName.c_str(), dwAccess, dwShare, nullptr,
- dwCreation, FILE_ATTRIBUTE_NORMAL, nullptr);
+ m_hFile = ::CreateFileA(fileName.unterminated_c_str(), dwAccess, dwShare,
+ nullptr, dwCreation, FILE_ATTRIBUTE_NORMAL, nullptr);
if (m_hFile == INVALID_HANDLE_VALUE)
m_hFile = nullptr;
@@ -72,8 +72,9 @@ bool CFXCRT_FileAccess_Win64::Open(const CFX_WideStringC& fileName,
uint32_t dwAccess, dwShare, dwCreation;
FXCRT_Windows_GetFileMode(dwMode, dwAccess, dwShare, dwCreation);
- m_hFile = ::CreateFileW((LPCWSTR)fileName.c_str(), dwAccess, dwShare, nullptr,
- dwCreation, FILE_ATTRIBUTE_NORMAL, nullptr);
+ m_hFile =
+ ::CreateFileW((LPCWSTR)fileName.unterminated_c_str(), dwAccess, dwShare,
+ nullptr, dwCreation, FILE_ATTRIBUTE_NORMAL, nullptr);
if (m_hFile == INVALID_HANDLE_VALUE)
m_hFile = nullptr;