Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 11 Aug 2015 01:02:18 +0000 (UTC)
From:      Marcelo Araujo <araujo@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r286609 - head/usr.bin/ypmatch
Message-ID:  <201508110102.t7B12InB038997@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: araujo
Date: Tue Aug 11 01:02:17 2015
New Revision: 286609
URL: https://svnweb.freebsd.org/changeset/base/286609

Log:
  More style(9) fixes. No functional changes.
  
  Differential Revision:	D3350
  Reviewed by:		ed
  Approved by:		bapt (mentor)

Modified:
  head/usr.bin/ypmatch/ypmatch.c

Modified: head/usr.bin/ypmatch/ypmatch.c
==============================================================================
--- head/usr.bin/ypmatch/ypmatch.c	Mon Aug 10 22:30:13 2015	(r286608)
+++ head/usr.bin/ypmatch/ypmatch.c	Tue Aug 11 01:02:17 2015	(r286609)
@@ -68,12 +68,6 @@ usage(void)
 	fprintf(stderr, "%s\n%s\n",
 	    "usage: ypmatch [-kt] [-d domainname] key ... mapname",
 	    "       ypmatch -x");
-	fprintf(stderr,
-	    "where\n"
-	    "\tmapname may be either a mapname or a nickname for a map.\n"
-	    "\t-k prints keys as well as values.\n"
-	    "\t-t inhibits map nickname translation.\n"
-	    "\t-x dumps the map nickname translation table.\n");
 	exit(1);
 }
 
@@ -87,10 +81,10 @@ main(int argc, char *argv[])
 
 	domainname = NULL;
 	notrans = key = 0;
-	while ((c=getopt(argc, argv, "xd:kt")) != -1)
+	while ((c = getopt(argc, argv, "xd:kt")) != -1)
 		switch (c) {
 		case 'x':
-			for (i=0; i<sizeof ypaliases/sizeof ypaliases[0]; i++)
+			for (i = 0; i < nitems(ypaliases); i++)
 				printf("Use \"%s\" for \"%s\"\n",
 					ypaliases[i].alias,
 					ypaliases[i].name);
@@ -108,22 +102,21 @@ main(int argc, char *argv[])
 			usage();
 		}
 
-	if ((argc-optind) < 2 )
+	if (argc - optind < 2)
 		usage();
 
-	if (domainname == NULL) {
+	if (domainname == NULL)
 		yp_get_default_domain(&domainname);
-	}
 
 	inmap = argv[argc-1];
 	if (notrans == 0) {
-		for (i=0; i<sizeof ypaliases/sizeof ypaliases[0]; i++)
+		for (i = 0; i < nitems(ypaliases); i++)
 			if (strcmp(inmap, ypaliases[i].alias) == 0)
 				inmap = ypaliases[i].name;
 	}
 
 	rval = 0;
-	for (; optind < argc-1; optind++) {
+	for (; optind < argc - 1; optind++) {
 		inkey = argv[optind];
 
 		r = yp_match(domainname, inmap, inkey,
@@ -137,7 +130,7 @@ main(int argc, char *argv[])
 		case YPERR_YPBIND:
 			errx(1, "not running ypbind");
 		default:
-			errx(1, "can't match key %s in map %s. Reason: %s",
+			errx(1, "can't match key %s in map %s. reason: %s",
 			    inkey, inmap, yperr_string(r));
 			rval = 1;
 			break;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201508110102.t7B12InB038997>