From 894d33c8215e670759c931986d9035e6e8432850 Mon Sep 17 00:00:00 2001 From: Theo de Raadt Date: Mon, 20 Jul 1998 19:57:18 +0000 Subject: stupid SIGSEGV --- usr.bin/asa/asa.c | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'usr.bin') 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 @@ -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); } -- cgit v1.2.3