Printf related fixes.

This commit is contained in:
Rosen Penev authored and Simon Kelley committed 2017-06-27 22:29:51 +01:00
1 parent 50a2841d34
commit cbd29e5da8
7 files changed
+16 -14

No files matched your search

+4 -4
View File
@@ -448,13 +448,13 @@ void prettyprint_time(char *buf, unsigned int t)
{
unsigned int x, p = 0;
if ((x = t/86400))
p += sprintf(&buf[p], "%dd", x);
p += sprintf(&buf[p], "%ud", x);
if ((x = (t/3600)%24))
p += sprintf(&buf[p], "%dh", x);
p += sprintf(&buf[p], "%uh", x);
if ((x = (t/60)%60))
p += sprintf(&buf[p], "%dm", x);
p += sprintf(&buf[p], "%um", x);
if ((x = t%60))
p += sprintf(&buf[p], "%ds", x);
p += sprintf(&buf[p], "%us", x);
}
}