Resolved strncpy -Wstringop-truncation warning in Qt NES header editor.

This commit is contained in:
harry 2023-01-29 11:28:58 -05:00
parent 727e403917
commit 421c7b35e7
1 changed files with 1 additions and 1 deletions

View File

@ -827,7 +827,7 @@ bool iNesHeaderEditor_t::openFile(void)
if ( GameInfo == NULL )
{
strncpy( LoadedRomFName, filename.toStdString().c_str(), sizeof(LoadedRomFName) );
strncpy( LoadedRomFName, filename.toStdString().c_str(), sizeof(LoadedRomFName)-1 );
LoadedRomFName[sizeof(LoadedRomFName)-1] = 0;
}