aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/quota
diff options
context:
space:
mode:
authorSergey Kandaurov <pluknet@FreeBSD.org>2011-06-30 09:20:26 +0000
committerSergey Kandaurov <pluknet@FreeBSD.org>2011-06-30 09:20:26 +0000
commit2f39985f003eb992300b8c72621fb9f862165f11 (patch)
tree575265b5d6e4cdf5e24b18371edd3a23bd818157 /usr.bin/quota
parent85e9da38fe3dd374b1f06752f7b462edb4fedc78 (diff)
downloadsrc-2f39985f003eb992300b8c72621fb9f862165f11.tar.gz
src-2f39985f003eb992300b8c72621fb9f862165f11.zip
Notes
Diffstat (limited to 'usr.bin/quota')
-rw-r--r--usr.bin/quota/quota.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/usr.bin/quota/quota.c b/usr.bin/quota/quota.c
index 6cc35173a082..67d9c5a6b032 100644
--- a/usr.bin/quota/quota.c
+++ b/usr.bin/quota/quota.c
@@ -264,8 +264,11 @@ prthumanval(int len, u_int64_t bytes)
{
char buf[len + 1];
- humanize_number(buf, sizeof(buf), bytes, "", HN_AUTOSCALE,
- HN_B | HN_NOSPACE | HN_DECIMAL);
+ /*
+ * Limit the width to 5 bytes as that is what users expect.
+ */
+ humanize_number(buf, sizeof(buf) < 5 ? sizeof(buf) : 5, bytes, "",
+ HN_AUTOSCALE, HN_B | HN_NOSPACE | HN_DECIMAL);
(void)printf(" %*s", len, buf);
}
@@ -352,10 +355,13 @@ showquotas(int type, u_long id, const char *name)
prthumanval(7, dbtob(qup->dqblk.dqb_bhardlimit));
} else {
printf(" %7ju%c %7ju %7ju",
- dbtob(1024) * (uintmax_t)qup->dqblk.dqb_curblocks,
+ (uintmax_t)dbtob(qup->dqblk.dqb_curblocks)
+ / 1024,
(msgb == NULL) ? ' ' : '*',
- dbtob(1024) * (uintmax_t)qup->dqblk.dqb_bsoftlimit,
- dbtob(1024) * (uintmax_t)qup->dqblk.dqb_bhardlimit);
+ (uintmax_t)dbtob(qup->dqblk.dqb_bsoftlimit)
+ / 1024,
+ (uintmax_t)dbtob(qup->dqblk.dqb_bhardlimit)
+ / 1024);
}
if (msgb != NULL)
bgrace = timeprt(qup->dqblk.dqb_btime);