fix(Core/Misc): GCC warnings (#3428)

This commit is contained in:
Francesco Borzì
2020-09-04 17:39:02 +02:00
committed by GitHub
parent 0c2dce03cc
commit fa6f814eba
2 changed files with 14 additions and 2 deletions

View File

@@ -235,7 +235,13 @@ std::string TimeToTimestampStr(time_t t)
// MM minutes (2 digits 00-59)
// SS seconds (2 digits 00-59)
char buf[20];
snprintf(buf, 20, "%04d-%02d-%02d_%02d-%02d-%02d", aTm.tm_year+1900, aTm.tm_mon+1, aTm.tm_mday, aTm.tm_hour, aTm.tm_min, aTm.tm_sec);
int ret = snprintf(buf, 20, "%04d-%02d-%02d_%02d-%02d-%02d", aTm.tm_year+1900, aTm.tm_mon+1, aTm.tm_mday, aTm.tm_hour, aTm.tm_min, aTm.tm_sec);
if (ret < 0)
{
return std::string("ERROR");
}
return std::string(buf);
}