Module Name: src
Committed By: bouyer
Date: Mon Mar 7 11:46:55 UTC 2011
Modified Files:
src/usr.bin/quota: printquota.c
Log Message:
Properly evaluate the space needed to print "unlimited" in an human-readable
way.
To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/usr.bin/quota/printquota.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.bin/quota/printquota.c
diff -u src/usr.bin/quota/printquota.c:1.4 src/usr.bin/quota/printquota.c:1.5
--- src/usr.bin/quota/printquota.c:1.4 Sun Mar 6 22:36:07 2011
+++ src/usr.bin/quota/printquota.c Mon Mar 7 11:46:55 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: printquota.c,v 1.4 2011/03/06 22:36:07 christos Exp $ */
+/* $NetBSD: printquota.c,v 1.5 2011/03/07 11:46:55 bouyer Exp $ */
/*
* Copyright (c) 1980, 1990, 1993
@@ -42,7 +42,7 @@
#if 0
static char sccsid[] = "@(#)quota.c 8.4 (Berkeley) 4/28/95";
#else
-__RCSID("$NetBSD: printquota.c,v 1.4 2011/03/06 22:36:07 christos Exp $");
+__RCSID("$NetBSD: printquota.c,v 1.5 2011/03/07 11:46:55 bouyer Exp $");
#endif
#endif /* not lint */
@@ -68,7 +68,7 @@
intprt(char *buf, size_t len, uint64_t val, int flags, int hflag)
{
if (val == UQUAD_MAX)
- return (len >= sizeof("unlimited")) ? "unlimited" : "-";
+ return (len > sizeof("unlimited")) ? "unlimited" : "-";
if (flags & HN_B)
val = dbtob(val);