diff --git a/FEXHeaderUtils/FEXHeaderUtils/Filesystem.h b/FEXHeaderUtils/FEXHeaderUtils/Filesystem.h index 44c784d24..b00cc588c 100644 --- a/FEXHeaderUtils/FEXHeaderUtils/Filesystem.h +++ b/FEXHeaderUtils/FEXHeaderUtils/Filesystem.h @@ -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; }