Set the program name before trying to use it.

Found by: Aage Robekk <aagero@aage.priv.no>
This commit is contained in:
Alexander Langer 1996-06-18 01:46:34 +00:00
parent 9b2b0822b7
commit 2a7a2545a4
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=16472

View file

@ -16,7 +16,7 @@
*
* NEW command line interface for IP firewall facility
*
* $Id: ipfw.c,v 1.24 1996/05/11 20:31:55 phk Exp $
* $Id: ipfw.c,v 1.25 1996/06/09 23:46:22 alex Exp $
*
*/
@ -833,6 +833,8 @@ main(ac, av)
int i;
FILE *f;
strcpy(progname,*av);
s = socket( AF_INET, SOCK_RAW, IPPROTO_RAW );
if ( s < 0 ) {
fprintf(stderr,"%s: Can't open raw socket.\n"
@ -842,8 +844,6 @@ main(ac, av)
setbuf(stdout,0);
strcpy(progname,*av);
if (av[1] && !access(av[1], R_OK)) {
lineno = 0;
f = fopen(av[1], "r");