Skip to content

Commit 3a20049

Browse files
committed
Merge pull request #107496 from akien-mga/mono-fixup-string-resize_uninitialized
Fix Mono build on Windows after `String::resize` rename
2 parents ee84a5a + 3be63ec commit 3a20049

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

modules/mono/utils/path_utils.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ String cwd() {
8787
const DWORD expected_size = ::GetCurrentDirectoryW(0, nullptr);
8888

8989
Char16String buffer;
90-
buffer.resize((int)expected_size);
90+
buffer.resize_uninitialized((int)expected_size);
9191
if (::GetCurrentDirectoryW(expected_size, (wchar_t *)buffer.ptrw()) == 0) {
9292
return ".";
9393
}
@@ -139,7 +139,7 @@ String realpath(const String &p_path) {
139139
}
140140

141141
Char16String buffer;
142-
buffer.resize((int)expected_size);
142+
buffer.resize_uninitialized((int)expected_size);
143143
::GetFinalPathNameByHandleW(hFile, (wchar_t *)buffer.ptrw(), expected_size, FILE_NAME_NORMALIZED);
144144

145145
::CloseHandle(hFile);

0 commit comments

Comments
 (0)