Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/quota Properly evaluate the space needed to print "u...



details:   https://anonhg.NetBSD.org/src/rev/49cdd50e091e
branches:  trunk
changeset: 762986:49cdd50e091e
user:      bouyer <bouyer%NetBSD.org@localhost>
date:      Mon Mar 07 11:46:55 2011 +0000

description:
Properly evaluate the space needed to print "unlimited" in an human-readable
way.

diffstat:

 usr.bin/quota/printquota.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 739c4401b887 -r 49cdd50e091e usr.bin/quota/printquota.c
--- a/usr.bin/quota/printquota.c        Mon Mar 07 11:25:41 2011 +0000
+++ b/usr.bin/quota/printquota.c        Mon Mar 07 11:46:55 2011 +0000
@@ -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);



Home | Main Index | Thread Index | Old Index