diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1998-07-20 19:57:18 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1998-07-20 19:57:18 +0000 |
commit | 894d33c8215e670759c931986d9035e6e8432850 (patch) | |
tree | 0f07541fde93f2f957093718cce7decebbe7b4cb /usr.bin | |
parent | 213f29480add6be9bf827a729dd61e1bb8fe1cb7 (diff) |
stupid SIGSEGV
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/asa/asa.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/usr.bin/asa/asa.c b/usr.bin/asa/asa.c index e8a5d78dcf3..d298699c69e 100644 --- a/usr.bin/asa/asa.c +++ b/usr.bin/asa/asa.c @@ -1,4 +1,4 @@ -/* $OpenBSD: asa.c,v 1.2 1996/06/26 05:31:25 deraadt Exp $ */ +/* $OpenBSD: asa.c,v 1.3 1998/07/20 19:57:17 deraadt Exp $ */ /* $NetBSD: asa.c,v 1.10 1995/04/21 03:01:41 cgd Exp $ */ /* @@ -32,7 +32,7 @@ */ #ifndef lint -static char rcsid[] = "$OpenBSD: asa.c,v 1.2 1996/06/26 05:31:25 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: asa.c,v 1.3 1998/07/20 19:57:17 deraadt Exp $"; #endif #include <stdio.h> @@ -51,18 +51,19 @@ main (argc, argv) /* skip progname */ argv++; - fp = stdin; - do { - if (*argv) { - if (!(fp = fopen(*argv, "r"))) { + fp = stdin; + do { + if (*argv) { + if (!(fp = fopen(*argv, "r"))) { warn ("%s", *argv); continue; - } - } - asa (fp); - if (fp != stdin) - (void)fclose(fp); - } while (*argv++); + } + } + if (fp) + asa (fp); + if (fp && fp != stdin) + (void)fclose(fp); + } while (*argv++); exit (0); } |