segmentation error (core dumped) Linux in c
hello,
how do u deal this segmentation error (core dumped) after compile program using this commend:
gcc -g -O2 -Wall -o descry descry.o -lpcap -lnet.
see this following main part
int
main(int argc, char *argv[])
{
int c;
u_char flags;
char *device;
char *capture_file;
struct des_pack *gp;
printf("[TCP port scan detection tool]\n");
flags = 0;
device = NULL;
capture_file = NULL;
while ((c = getopt(argc, argv, "afi:vs:h")) != EOF)
{
switch (c)
{
case 'a':
flags |= ALL_HOSTS;
break;
case 'f':
capture_file = optarg;
break;
case 'i':
device = optarg;
break;
case 'v':
break;
case 's':
flags |= DO_SYSLOG;
break;
case 'h':
default:
usage(argv[0]);
return (EXIT_FAILURE);
}
}
Last edited by nasim751; 01-26-2008 at 08:48 AM.
|