Sort cases in getopt switch statement.
Remove extra parens from my host selection commit. Add white space after if, while, for and switch. Get rid of braces around a single statement if. There should be no functional changes in this commit. Reviewed by: sheldonh
This commit is contained in:
parent
91c8cf2367
commit
09a589b8f1
@ -313,16 +313,23 @@ main(argc, argv)
|
||||
|
||||
while ((ch = getopt(argc, argv, "a:dl:f:m:p:rsuv")) != -1)
|
||||
switch (ch) {
|
||||
case 'd': /* debug */
|
||||
Debug++;
|
||||
break;
|
||||
case 'a': /* allow specific network addresses only */
|
||||
if (allowaddr(optarg) == -1)
|
||||
usage();
|
||||
break;
|
||||
case 'd': /* debug */
|
||||
Debug++;
|
||||
break;
|
||||
case 'f': /* configuration file */
|
||||
ConfFile = optarg;
|
||||
break;
|
||||
case 'l':
|
||||
if (nfunix < MAXFUNIX)
|
||||
funixn[nfunix++] = optarg;
|
||||
else
|
||||
warnx("out of descriptors, ignoring %s",
|
||||
optarg);
|
||||
break;
|
||||
case 'm': /* mark interval */
|
||||
MarkInterval = atoi(optarg) * 60;
|
||||
break;
|
||||
@ -335,13 +342,6 @@ main(argc, argv)
|
||||
case 's': /* no network mode */
|
||||
SecureMode++;
|
||||
break;
|
||||
case 'l':
|
||||
if (nfunix < MAXFUNIX)
|
||||
funixn[nfunix++] = optarg;
|
||||
else
|
||||
warnx("out of descriptors, ignoring %s",
|
||||
optarg);
|
||||
break;
|
||||
case 'u': /* only log specified priority */
|
||||
UniquePriority++;
|
||||
break;
|
||||
@ -764,11 +764,11 @@ logmsg(pri, msg, from, flags)
|
||||
if (f->f_host)
|
||||
switch (f->f_host[0]) {
|
||||
case '+':
|
||||
if((strcmp(from, f->f_host + 1) != 0) )
|
||||
if (strcmp(from, f->f_host + 1) != 0)
|
||||
continue;
|
||||
break;
|
||||
case '-':
|
||||
if((strcmp(from, f->f_host + 1) == 0) )
|
||||
if (strcmp(from, f->f_host + 1) == 0)
|
||||
continue;
|
||||
break;
|
||||
}
|
||||
@ -1408,9 +1408,8 @@ init(signo)
|
||||
printf("%s, ", f->f_un.f_uname[i]);
|
||||
break;
|
||||
}
|
||||
if(f->f_program) {
|
||||
if (f->f_program)
|
||||
printf(" (%s)", f->f_program);
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
}
|
||||
@ -1444,14 +1443,16 @@ cfline(line, f, prog, host)
|
||||
f->f_pmask[i] = INTERNAL_NOPRI;
|
||||
|
||||
/* save hostname if any */
|
||||
if (host && *host == '*') host = NULL;
|
||||
if (host && *host == '*')
|
||||
host = NULL;
|
||||
if (host)
|
||||
f->f_host = strdup(host);
|
||||
|
||||
/* save program name if any */
|
||||
if(prog && *prog=='*') prog = NULL;
|
||||
if (prog && *prog == '*')
|
||||
prog = NULL;
|
||||
if (prog)
|
||||
f->f_program = strdup(host);
|
||||
f->f_program = strdup(prog);
|
||||
|
||||
/* scan through the list of selectors */
|
||||
for (p = line; *p && *p != '\t' && *p != ' ';) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user