Fix wrong human-readable ETA output.

This commit is contained in:
Steven Schubiger 2009-05-17 12:53:28 +02:00
parent faa3908610
commit 2e1619d3fe
2 changed files with 6 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2009-05-17 Steven Schubiger <stsc@member.fsf.org>
* progress.c (eta_to_human_short): Fix the remaining hours
to be displayed. Spotted by Tadeu Martins (#26411).
2009-04-24 Micah Cowan <micah@cowan.name>
* hash.c: Change stdint.h inclusion to use HAVE_STDINT_H, not C99

View File

@ -1157,7 +1157,7 @@ eta_to_human_short (int secs, bool condensed)
else if (secs < 48 * 3600)
sprintf (buf, "%dh%s%dm", secs / 3600, space, (secs / 60) % 60);
else if (secs < 100 * 86400)
sprintf (buf, "%dd%s%dh", secs / 86400, space, (secs / 3600) % 60);
sprintf (buf, "%dd%s%dh", secs / 86400, space, (secs / 3600) % 24);
else
/* even (2^31-1)/86400 doesn't overflow BUF. */
sprintf (buf, "%dd", secs / 86400);