summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormmcc <mmcc@openbsd.org>2016-03-07 01:19:46 +0000
committermmcc <mmcc@openbsd.org>2016-03-07 01:19:46 +0000
commit596cc809633c49e6f47179468caaf3ee9767acf5 (patch)
tree9670be3e69f5e9a673831284903f85c527fbfa14
parent(type *)0 -> NULL (diff)
downloadwireguard-openbsd-596cc809633c49e6f47179468caaf3ee9767acf5.tar.xz
wireguard-openbsd-596cc809633c49e6f47179468caaf3ee9767acf5.zip
simplify print formatting logic, replace exit() in main() with return
from Michal Mazurek, ok tb@
-rw-r--r--bin/df/df.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/bin/df/df.c b/bin/df/df.c
index 589d0e05cd1..7f4bb3ae636 100644
--- a/bin/df/df.c
+++ b/bin/df/df.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: df.c,v 1.56 2016/03/01 18:00:42 mmcc Exp $ */
+/* $OpenBSD: df.c,v 1.57 2016/03/07 01:19:46 mmcc Exp $ */
/* $NetBSD: df.c,v 1.21.2.1 1995/11/01 00:06:11 jtc Exp $ */
/*
@@ -161,23 +161,20 @@ main(int argc, char *argv[])
}
if (mntsize) {
- maxwidth = 0;
+ maxwidth = 11;
for (i = 0; i < mntsize; i++) {
width = strlen(mntbuf[i].f_mntfromname);
if (width > maxwidth)
maxwidth = width;
}
- if (maxwidth < 11)
- maxwidth = 11;
-
if (Pflag)
posixprint(mntbuf, mntsize, maxwidth);
else
bsdprint(mntbuf, mntsize, maxwidth);
}
- exit(mntsize ? 0 : 1);
+ return (mntsize ? 0 : 1);
}
char *