mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-14 03:58:18 +00:00
Fix crash in GetSaves (fixes #4500)
This commit is contained in:
parent
fe0fb200a0
commit
2727c998c2
|
@ -1641,11 +1641,11 @@ bool CScoreWorker::GetSaves(IDbConnection *pSqlServer, const ISqlData *pGameData
|
||||||
if(!End)
|
if(!End)
|
||||||
{
|
{
|
||||||
int NumSaves = pSqlServer->GetInt(1);
|
int NumSaves = pSqlServer->GetInt(1);
|
||||||
|
char aLastSavedString[60] = "\0";
|
||||||
|
if(!pSqlServer->IsNull(2))
|
||||||
|
{
|
||||||
int Ago = pSqlServer->GetInt(2);
|
int Ago = pSqlServer->GetInt(2);
|
||||||
char aAgoString[40] = "\0";
|
char aAgoString[40] = "\0";
|
||||||
char aLastSavedString[60] = "\0";
|
|
||||||
if(Ago)
|
|
||||||
{
|
|
||||||
sqlstr::AgoTimeToString(Ago, aAgoString, sizeof(aAgoString));
|
sqlstr::AgoTimeToString(Ago, aAgoString, sizeof(aAgoString));
|
||||||
str_format(aLastSavedString, sizeof(aLastSavedString), ", last saved %s ago", aAgoString);
|
str_format(aLastSavedString, sizeof(aLastSavedString), ", last saved %s ago", aAgoString);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue