aboutsummaryrefslogtreecommitdiff
path: root/lib/progress.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2004-03-23 15:06:14 +0000
committerDaniel Stenberg <daniel@haxx.se>2004-03-23 15:06:14 +0000
commit306ff5649ae01afe53416fd5bc24537109ae9a03 (patch)
treea34915cd77beac0924a170f196828d43b774c29d /lib/progress.c
parent1c652dfc5db7e77a56ef38a51d9190d214276e5d (diff)
made time2str() use longs internally instead to prevent compiler warnings
when converting to ints
Diffstat (limited to 'lib/progress.c')
-rw-r--r--lib/progress.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/progress.c b/lib/progress.c
index 0c15e4b3d..9a1cef7aa 100644
--- a/lib/progress.c
+++ b/lib/progress.c
@@ -42,24 +42,24 @@
byte) */
static void time2str(char *r, long t)
{
- int h;
+ long h;
if(!t) {
strcpy(r, "--:--:--");
return;
}
h = (t/3600);
if(h <= 99) {
- int m = (t-(h*3600))/60;
- int s = (t-(h*3600)-(m*60));
- sprintf(r, "%2d:%02d:%02d",h,m,s);
+ long m = (t-(h*3600))/60;
+ long s = (t-(h*3600)-(m*60));
+ sprintf(r, "%2ld:%02ld:%02ld",h,m,s);
}
else {
/* this equals to more than 99 hours, switch to a more suitable output
format to fit within the limits. */
if(h/24 <= 999)
- sprintf(r, "%3dd %02dh", h/24, h-(h/24)*24);
+ sprintf(r, "%3ldd %02ldh", h/24, h-(h/24)*24);
else
- sprintf(r, "%7dd", h/24);
+ sprintf(r, "%7ldd", h/24);
}
}