summaryrefslogtreecommitdiff
path: root/usr.sbin/ypserv/mknetid/mknetid.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2002-07-19 02:38:41 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2002-07-19 02:38:41 +0000
commite2e599c8ed62c4886dfcebc74b0d3bf7436b418e (patch)
tree9a49861d623e3d5520a4114bbb545f3beb994dcf /usr.sbin/ypserv/mknetid/mknetid.c
parent1cccfea064ca712bce2bfdebd5da7f086362a656 (diff)
4344 lines of KNF diff
Diffstat (limited to 'usr.sbin/ypserv/mknetid/mknetid.c')
-rw-r--r--usr.sbin/ypserv/mknetid/mknetid.c53
1 files changed, 17 insertions, 36 deletions
diff --git a/usr.sbin/ypserv/mknetid/mknetid.c b/usr.sbin/ypserv/mknetid/mknetid.c
index f20422cdbc6..0c1a702021a 100644
--- a/usr.sbin/ypserv/mknetid/mknetid.c
+++ b/usr.sbin/ypserv/mknetid/mknetid.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mknetid.c,v 1.7 2002/02/13 23:10:46 deraadt Exp $ */
+/* $OpenBSD: mknetid.c,v 1.8 2002/07/19 02:38:40 deraadt Exp $ */
/*
* Copyright (c) 1996 Mats O Jansson <moj@stacken.kth.se>
@@ -32,7 +32,7 @@
*/
#ifndef LINT
-static char rcsid[] = "$OpenBSD: mknetid.c,v 1.7 2002/02/13 23:10:46 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: mknetid.c,v 1.8 2002/07/19 02:38:40 deraadt Exp $";
#endif
#include <sys/param.h>
@@ -89,10 +89,7 @@ struct user *root = NULL, *tail = NULL;
struct user *hroot[HASHMAX], *htail[HASHMAX];
int
-read_line(fp, buf, size)
- FILE *fp;
- char *buf;
- int size;
+read_line(FILE *fp, char *buf, int size)
{
int done = 0;
@@ -124,8 +121,7 @@ read_line(fp, buf, size)
}
int
-hashidx(key)
-char key;
+hashidx(char key)
{
if (key < 'A')
return (0);
@@ -139,8 +135,7 @@ char key;
}
void
-add_user(username, uid, gid)
-char *username, *uid, *gid;
+add_user(char *username, char *uid, char *gid)
{
struct user *u;
int idx;
@@ -172,8 +167,7 @@ char *username, *uid, *gid;
}
}
-void add_group(username, gid)
-char *username, *gid;
+void add_group(char *username, char *gid)
{
struct user *u;
int idx, g;
@@ -197,9 +191,7 @@ char *username, *gid;
}
void
-read_passwd(pfile, fname)
-FILE *pfile;
-char *fname;
+read_passwd(FILE *pfile, char *fname)
{
char line[1024];
int line_no = 0;
@@ -217,7 +209,7 @@ char *fname;
/*
* Check if we have the whole line
- */
+ */
if (line[len-1] != '\n') {
fprintf(stderr, "line %d in \"%s\" is too long\n",
line_no, fname);
@@ -274,10 +266,9 @@ char *fname;
}
int
-isgsep(ch)
- char ch;
+isgsep(char ch)
{
- switch(ch) {
+ switch (ch) {
case ',':
case ' ':
case '\t':
@@ -289,9 +280,7 @@ isgsep(ch)
}
void
-read_group(gfile, fname)
- FILE *gfile;
- char *fname;
+read_group(FILE *gfile, char *fname)
{
char line[2048];
int line_no = 0;
@@ -374,9 +363,7 @@ read_group(gfile, fname)
}
void
-print_passwd_group(qflag, domain)
- int qflag;
- char *domain;
+print_passwd_group(int qflag, char *domain)
{
struct user *u, *p;
int i;
@@ -411,9 +398,7 @@ print_passwd_group(qflag, domain)
}
void
-print_hosts(pfile, fname, domain)
- FILE *pfile;
- char *fname, *domain;
+print_hosts(FILE *pfile, char *fname, char *domain)
{
char line[1024];
int line_no = 0;
@@ -431,7 +416,7 @@ print_hosts(pfile, fname, domain)
/*
* Check if we have the whole line
- */
+ */
if (line[len-1] != '\n') {
fprintf(stderr, "line %d in \"%s\" is too long\n",
line_no, fname);
@@ -466,9 +451,7 @@ print_hosts(pfile, fname, domain)
}
void
-print_netid(mfile, fname)
-FILE *mfile;
-char *fname;
+print_netid(FILE *mfile, char *fname)
{
char line[1024];
int line_no = 0;
@@ -486,7 +469,7 @@ char *fname;
/*
* Check if we have the whole line
- */
+ */
if (line[len-1] != '\n') {
fprintf(stderr, "line %d in \"%s\" is too long\n",
line_no, fname);
@@ -521,9 +504,7 @@ char *fname;
}
int
-main(argc, argv)
- int argc;
- char *argv[];
+main(int argc, char *argv[])
{
int qflag, ch, usage;
char *domain;