CMemoryCardSys: Fix -Wstringop-truncation issue

This commit is contained in:
Luke Street 2021-04-05 13:31:00 -04:00
parent ab16eb5d07
commit 53fb23fc17
1 changed files with 2 additions and 1 deletions

View File

@ -218,7 +218,8 @@ void CMemoryCardSys::CCardFileInfo::BuildCardBuffer() {
CMemoryOutStream w(x104_cardBuffer.data(), x104_cardBuffer.size()); CMemoryOutStream w(x104_cardBuffer.data(), x104_cardBuffer.size());
w.writeUint32Big(0); w.writeUint32Big(0);
char comment[64]; char comment[64];
strncpy(comment, x28_comment.data(), 64); std::memset(comment, 0, std::size(comment));
std::strncpy(comment, x28_comment.data(), std::size(comment) - 1);
w.writeBytes(comment, 64); w.writeBytes(comment, 64);
WriteBannerData(w); WriteBannerData(w);
WriteIconData(w); WriteIconData(w);