style(9): remove space between function name and opening parentheses,
sort variables, NULL is the null-pointer constant, remove unnecessary braces. PR: 36130 Approved by: mike
This commit is contained in:
parent
3990fae77a
commit
81c126e7d3
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=96626
@ -38,9 +38,9 @@ __RCSID("$NetBSD: asa.c,v 1.11 1997/09/20 14:55:00 lukem Exp $");
|
||||
#endif
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
#include <err.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <err.h>
|
||||
|
||||
static void asa __P((FILE *));
|
||||
int main __P((int, char *[]));
|
||||
@ -57,8 +57,8 @@ main (argc, argv)
|
||||
|
||||
fp = stdin;
|
||||
do {
|
||||
if (*argv) {
|
||||
if (!(fp = fopen(*argv, "r"))) {
|
||||
if (*argv != NULL) {
|
||||
if ((fp = fopen(*argv, "r")) == NULL) {
|
||||
warn("%s", *argv);
|
||||
continue;
|
||||
}
|
||||
@ -66,7 +66,7 @@ main (argc, argv)
|
||||
asa(fp);
|
||||
if (fp != stdin)
|
||||
(void)fclose(fp);
|
||||
} while (*argv++);
|
||||
} while (*argv++ != NULL);
|
||||
|
||||
exit(0);
|
||||
}
|
||||
@ -75,8 +75,8 @@ static void
|
||||
asa(f)
|
||||
FILE *f;
|
||||
{
|
||||
char *buf;
|
||||
size_t len;
|
||||
char *buf;
|
||||
|
||||
if ((buf = fgetln(f, &len)) != NULL) {
|
||||
if (buf[len - 1] == '\n')
|
||||
@ -91,9 +91,8 @@ asa(f)
|
||||
break;
|
||||
}
|
||||
|
||||
if (len > 1 && buf[0] && buf[1]) {
|
||||
if (len > 1 && buf[0] && buf[1])
|
||||
printf("%.*s", (int)(len - 1), buf + 1);
|
||||
}
|
||||
|
||||
while ((buf = fgetln(f, &len)) != NULL) {
|
||||
if (buf[len - 1] == '\n')
|
||||
@ -115,10 +114,9 @@ asa(f)
|
||||
break;
|
||||
}
|
||||
|
||||
if (len > 1 && buf[0] && buf[1]) {
|
||||
if (len > 1 && buf[0] && buf[1])
|
||||
printf("%.*s", (int)(len - 1), buf + 1);
|
||||
}
|
||||
}
|
||||
|
||||
putchar('\n');
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user