1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-06 13:09:50 +00:00

Initialize infp at main()

This commit is contained in:
Peter Wemm 2001-08-13 21:55:04 +00:00
parent ab01f43385
commit ef15bfc59f
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=81602

View File

@ -98,7 +98,7 @@ static struct str *nodestr[MAXTYPES]; /* type of structure used by the node */
static int nstr; /* number of structures */ static int nstr; /* number of structures */
static struct str str[MAXTYPES]; /* the structures */ static struct str str[MAXTYPES]; /* the structures */
static struct str *curstr; /* current structure */ static struct str *curstr; /* current structure */
static FILE *infp = stdin; static FILE *infp;
static char line[1024]; static char line[1024];
static int linno; static int linno;
static char *linep; static char *linep;
@ -123,6 +123,7 @@ main(argc, argv)
{ {
if (argc != 3) if (argc != 3)
error("usage: mknodes file"); error("usage: mknodes file");
infp = stdin;
if ((infp = fopen(argv[1], "r")) == NULL) if ((infp = fopen(argv[1], "r")) == NULL)
error("Can't open %s: %s", argv[1], strerror(errno)); error("Can't open %s: %s", argv[1], strerror(errno));
while (readline()) { while (readline()) {