aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/fetch/fetch.c
diff options
context:
space:
mode:
authorLukas Ertl <le@FreeBSD.org>2004-05-19 11:07:30 +0000
committerLukas Ertl <le@FreeBSD.org>2004-05-19 11:07:30 +0000
commitbe28a6af389d4a935967d9457380e15efe0d70bb (patch)
tree08f7bba86234256c6535872bdcafb3065a970d17 /usr.bin/fetch/fetch.c
parenta12d0a1aeecfc3874cfd7a5beaa84276f6c83ece (diff)
downloadsrc-be28a6af389d4a935967d9457380e15efe0d70bb.tar.gz
src-be28a6af389d4a935967d9457380e15efe0d70bb.zip
Notes
Diffstat (limited to 'usr.bin/fetch/fetch.c')
-rw-r--r--usr.bin/fetch/fetch.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/fetch/fetch.c b/usr.bin/fetch/fetch.c
index 051b8954ceb5..931a8ea89ee7 100644
--- a/usr.bin/fetch/fetch.c
+++ b/usr.bin/fetch/fetch.c
@@ -148,7 +148,7 @@ stat_eta(struct xferstat *xs)
*/
static const char *prefixes = " kMGTP";
static const char *
-stat_bytes(size_t bytes)
+stat_bytes(off_t bytes)
{
static char str[16];
const char *prefix = prefixes;
@@ -157,7 +157,7 @@ stat_bytes(size_t bytes)
bytes /= 1024;
prefix++;
}
- snprintf(str, sizeof str, "%4zu %cB", bytes, *prefix);
+ snprintf(str, sizeof str, "%4jd %cB", (intmax_t)bytes, *prefix);
return (str);
}
@@ -176,7 +176,7 @@ stat_bps(struct xferstat *xs)
snprintf(str, sizeof str, "?? Bps");
} else {
bps = (xs->rcvd - xs->offset) / delta;
- snprintf(str, sizeof str, "%sps", stat_bytes((size_t)bps));
+ snprintf(str, sizeof str, "%sps", stat_bytes((off_t)bps));
}
return (str);
}