fix from James Jegers <jimj@miller.cs.uwm.edu>. Netstat -w didn't work

(and would seg fault, too).  solution: tell getopt to expect an argument,
and set the appropriate flags when -w is given.
This commit is contained in:
cgd 1993-12-22 04:00:31 +00:00
parent f0e170dc10
commit 14fc658d66

View File

@ -39,7 +39,7 @@ char copyright[] =
#ifndef lint
/*static char sccsid[] = "from: @(#)main.c 5.23 (Berkeley) 7/1/91";*/
static char rcsid[] = "$Id: main.c,v 1.2 1993/08/01 18:10:50 mycroft Exp $";
static char rcsid[] = "$Id: main.c,v 1.3 1993/12/22 04:00:31 cgd Exp $";
#endif /* not lint */
#include <sys/param.h>
@ -228,7 +228,7 @@ main(argc, argv)
int ch;
void usage();
while ((ch = getopt(argc, argv, "Aadf:hI:iM:mN:np:rstuw")) != EOF)
while ((ch = getopt(argc, argv, "Aadf:hI:iM:mN:np:rstuw:")) != EOF)
switch((char)ch) {
case 'A':
Aflag = 1;
@ -305,6 +305,7 @@ main(argc, argv)
break;
case 'w':
interval = atoi(optarg);
iflag = 1;
break;
case '?':
default: