Fix C6001: using uninitialized memory

This commit is contained in:
Tulio Leao 2019-10-21 00:32:13 -03:00
parent 6cdbb901a5
commit 1bc399537e
2 changed files with 12 additions and 2 deletions

View file

@ -1353,6 +1353,11 @@ void Network::BeginServerLog()
{
format_string(logMessage, sizeof(logMessage), STR_LOG_SERVER_STARTED, nullptr);
}
else
{
logMessage[0] = '\0';
assert(0 && "Uninitialized mode");
}
AppendServerLog(logMessage);
}
@ -1376,6 +1381,11 @@ void Network::CloseServerLog()
{
format_string(logMessage, sizeof(logMessage), STR_LOG_SERVER_STOPPED, nullptr);
}
else
{
logMessage[0] = '\0';
assert(0 && "Uninitialized mode");
}
AppendServerLog(logMessage);
_server_log_fs.close();
}

View file

@ -168,8 +168,8 @@ void S6Exporter::Export()
auto temp = utf8_to_rct2(gS6Info.details);
safe_strcpy(_s6.info.details, temp.data(), sizeof(_s6.info.details));
}
uint32_t researchedTrackPiecesA[128];
uint32_t researchedTrackPiecesB[128];
uint32_t researchedTrackPiecesA[128] = {};
uint32_t researchedTrackPiecesB[128] = {};
for (int32_t i = 0; i < OBJECT_ENTRY_COUNT; i++)
{