Module Name:    src
Committed By:   christos
Date:           Sat Jan  7 18:45:13 UTC 2012

Modified Files:
        src/bin/df: df.c

Log Message:
use strspct.


To generate a diff of this commit:
cvs rdiff -u -r1.89 -r1.90 src/bin/df/df.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/bin/df/df.c
diff -u src/bin/df/df.c:1.89 src/bin/df/df.c:1.90
--- src/bin/df/df.c:1.89	Mon Aug 29 13:30:28 2011
+++ src/bin/df/df.c	Sat Jan  7 13:45:13 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: df.c,v 1.89 2011/08/29 17:30:28 gson Exp $ */
+/*	$NetBSD: df.c,v 1.90 2012/01/07 18:45:13 christos Exp $ */
 
 /*
  * Copyright (c) 1980, 1990, 1993, 1994
@@ -45,7 +45,7 @@ __COPYRIGHT(
 #if 0
 static char sccsid[] = "@(#)df.c	8.7 (Berkeley) 4/2/94";
 #else
-__RCSID("$NetBSD: df.c,v 1.89 2011/08/29 17:30:28 gson Exp $");
+__RCSID("$NetBSD: df.c,v 1.90 2012/01/07 18:45:13 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -473,7 +473,7 @@ prtstat(struct statvfs *sfsp, int maxwid
 		    fsbtoblk(sfsp->f_blocks, sfsp->f_frsize, blocksize),
 		    fsbtoblk(used, sfsp->f_frsize, blocksize),
 		    fsbtoblk(bavail, sfsp->f_frsize, blocksize),
-		    availblks == 0 ? full : strpct(pb, sizeof(pb), used,
+		    availblks == 0 ? full : strspct(pb, sizeof(pb), used,
 		    availblks, 0), sfsp->f_mntonname);
 		/*
 		 * another concession by the structured programming police to
@@ -495,15 +495,14 @@ prtstat(struct statvfs *sfsp, int maxwid
 		    fsbtoblk(bavail, sfsp->f_frsize, blocksize));
 	(void)printf(" %3s%%",
 	    availblks == 0 ? full :
-	    /* We know that these values are never negative */
-	    strpct(pb, sizeof(pb), used, availblks, 0));
+	    strspct(pb, sizeof(pb), used, availblks, 0));
 	if (iflag) {
 		inodes = sfsp->f_files;
 		used = inodes - sfsp->f_ffree;
 		(void)printf(" %8jd %8jd %3s%%",
 		    (intmax_t)used, (intmax_t)sfsp->f_ffree,
 		    inodes == 0 ? (used == 0 ? empty : full) :
-		    strpct(pb, sizeof(pb), used, inodes, 0));
+		    strspct(pb, sizeof(pb), used, inodes, 0));
 	}
 	(void)printf(" %s\n", sfsp->f_mntonname);
 }

Reply via email to