Filesystem: Fix Absolute() on Windows

sizeof(*Fill) will only ever be 1, so we wouldn't actually copy much of
anything.
This commit is contained in:
LC committed 2026-07-11 17:25:26 -04:00
1 parent fe6d6397d6
commit c878a89e95
1 file changed
+2 -1
+2 -1
View File
@@ -391,7 +391,8 @@ inline char* Absolute(const char* Path, char Fill[PATH_MAX]) {
std::error_code ec;
const auto PathAbsolute = std::filesystem::absolute(Path, ec);
if (!ec) {
strncpy(Fill, PathAbsolute.string().c_str(), sizeof(*Fill));
auto end = PathAbsolute.string().copy(Fill, PATH_MAX - 1);
Fill[end] = '\0';
return Fill;
}