Remove warning of -Wstringop-truncation

Fix the right length when strncpy. And use specific version of copy
to copy GameID.
This commit is contained in:
Jun Su 2020-03-23 13:50:00 +08:00
commit 7885fdb1ae
3 changed files with 5 additions and 5 deletions

View file

@ -341,8 +341,8 @@ static void CompressAndDumpState(CompressAndDumpState_args save_args)
}
// Setting up the header
StateHeader header;
strncpy(header.gameID, SConfig::GetInstance().GetGameID().c_str(), 6);
StateHeader header{};
SConfig::GetInstance().GetGameID().copy(header.gameID, std::size(header.gameID));
header.size = g_use_compression ? (u32)buffer_size : 0;
header.time = Common::Timer::GetDoubleTime();