Fix -Wstringop-truncation issues

This commit is contained in:
Luke Street 2021-04-05 13:25:40 -04:00
parent 2689533ad3
commit e66bc80c49
1 changed files with 2 additions and 1 deletions

View File

@ -645,7 +645,8 @@ int RecursiveMakeDir(const SystemChar* dir) {
SystemChar tmp[1024];
/* copy path */
std::strncpy(tmp, dir, std::size(tmp));
std::memset(tmp, 0, std::size(tmp));
std::strncpy(tmp, dir, std::size(tmp) - 1);
const size_t len = std::strlen(tmp);
if (len >= std::size(tmp)) {
return -1;