be safe while doing copy to EntityClass::flagnames

This commit is contained in:
Garux
2023-09-18 21:30:15 +06:00
parent 1a12e3b226
commit 1c3300d4bb
5 changed files with 7 additions and 7 deletions

View File

@@ -211,7 +211,7 @@ public:
std::size_t bit = atoi( element.attribute( "bit" ) );
ASSERT_MESSAGE( bit < MAX_FLAGS, "invalid flag bit" );
ASSERT_MESSAGE( string_empty( entityClass->flagnames[bit] ), "non-unique flag bit" );
strcpy( entityClass->flagnames[bit], key );
strncpy( entityClass->flagnames[bit], key, std::size( entityClass->flagnames[bit] ) - 1 );
entityClass->flagAttributes[bit] = m_attribute;
}
else if( entityClass->fixedsize && string_equal( type, "model" ) ){