1
0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-06-28 23:48:30 +02:00

Fix a couple spots where sizeof referred to array size

This commit is contained in:
Ethan Lee 2020-07-01 00:46:55 -04:00
parent 641277b430
commit 8e4be6112d

View File

@ -4659,7 +4659,7 @@ void Game::loadstats()
if (TextString.length()) if (TextString.length())
{ {
std::vector<std::string> values = split(TextString, ','); std::vector<std::string> values = split(TextString, ',');
for (size_t i = 0; i < std::min(sizeof(bestframes), values.size()); i++) for (size_t i = 0; i < std::min(sizeof(bestframes) / sizeof(int), values.size()); i++)
{ {
bestframes[i] = atoi(values[i].c_str()); bestframes[i] = atoi(values[i].c_str());
} }
@ -4980,7 +4980,7 @@ void Game::savestats()
dataNode->LinkEndChild( msg ); dataNode->LinkEndChild( msg );
std::string s_bestframes; std::string s_bestframes;
for (size_t i = 0; i < sizeof(bestframes); i++) for (size_t i = 0; i < sizeof(bestframes) / sizeof(int); i++)
{ {
s_bestframes += help.String(bestframes[i]) + ","; s_bestframes += help.String(bestframes[i]) + ",";
} }