Merge pull request #668 from BeamNG/fix_stringtable_zero_division

Fix for avoid a zero division on _StringTable::resize.
This commit is contained in:
Thomas Fischer 2014-05-26 08:38:19 +02:00
commit 46b213f828

View file

@ -195,8 +195,11 @@ StringTableEntry _StringTable::lookupn(const char* val, S32 len, const bool cas
}
//--------------------------------------
void _StringTable::resize(const U32 newSize)
void _StringTable::resize(const U32 _newSize)
{
/// avoid a possible 0 division
const U32 newSize = _newSize ? _newSize : 1;
Node *head = NULL, *walk, *temp;
U32 i;
// reverse individual bucket lists