Just trying to make things a little more standard.

Ross


Index: pf.4
===================================================================
RCS file: /cvs/src/share/man/man4/pf.4,v
retrieving revision 1.88
diff -u -p -r1.88 pf.4
--- pf.4        29 Aug 2017 02:16:56 -0000      1.88
+++ pf.4        8 Oct 2017 09:14:29 -0000
@@ -1011,11 +1011,11 @@ command to show the hard limit of a memo
 #include <netinet/in.h>
 #include <net/if.h>
 #include <net/pfvar.h>
+#include <err.h>
 #include <limits.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <err.h>
 
 static const struct {
        const char      *name;
@@ -1032,10 +1032,9 @@ static const struct {
 void
 usage(void)
 {
-       extern char *__progname;
        int i;
 
-       fprintf(stderr, "usage: %s [", __progname);
+       fprintf(stderr, "usage: %s [", getprogname());
        for (i = 0; pf_limits[i].name; i++)
                fprintf(stderr, "%s%s", (i > 0 ? "|" : ""), pf_limits[i].name);
        fprintf(stderr, "]\en");
@@ -1053,7 +1052,7 @@ main(int argc, char *argv[])
                usage();
 
        for (i = 0; pf_limits[i].name; i++)
-               if (!strcmp(argv[1], pf_limits[i].name)) {
+               if (strcmp(argv[1], pf_limits[i].name) == 0) {
                        pool_index = pf_limits[i].index;
                        break;
                }
@@ -1067,10 +1066,10 @@ main(int argc, char *argv[])
        if (dev == -1)
                err(1, "open(\e"/dev/pf\e") failed");
 
-       bzero(&pl, sizeof(struct pfioc_limit));
+       memset(&pl, 0, sizeof(struct pfioc_limit));
        pl.index = pool_index;
 
-       if (ioctl(dev, DIOCGETLIMIT, &pl))
+       if (ioctl(dev, DIOCGETLIMIT, &pl) != 0)
                err(1, "DIOCGETLIMIT");
 
        printf("The %s memory pool has ", pf_limits[i].name);
@@ -1079,7 +1078,7 @@ main(int argc, char *argv[])
        else
                printf("a hard limit of %u entries.\en", pl.limit);
 
-       return (0);
+       return 0;
 }
 .Ed
 .Sh SEE ALSO

Reply via email to