Merge pull request #4740 from wavexx/fix_get_time_dhm

Do not include (incorrect!) seconds in get_time_dhm
This commit is contained in:
enricoturri1966 2020-09-14 09:59:55 +02:00 committed by GitHub
commit 70536f8212
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -348,11 +348,11 @@ inline std::string get_time_dhm(float time_in_secs)
char buffer[64];
if (days > 0)
::sprintf(buffer, "%dd %dh %dm %ds", days, hours, minutes, (int)time_in_secs);
::sprintf(buffer, "%dd %dh %dm", days, hours, minutes);
else if (hours > 0)
::sprintf(buffer, "%dh %dm %ds", hours, minutes, (int)time_in_secs);
::sprintf(buffer, "%dh %dm", hours, minutes);
else if (minutes > 0)
::sprintf(buffer, "%dm %ds", minutes, (int)time_in_secs);
::sprintf(buffer, "%dm", minutes);
return buffer;
}