Possible Bug in BSD

sefunix%sefe.decnet at nwc-143b.arpa sefunix%sefe.decnet at nwc-143b.arpa
Thu Feb 26 08:46:42 AEST 1987


We have run into a little problem on both Ultrix-32m (DEC microvax)
and MT. Xinu 4.3BSD on a DEC microvax. Can someone try this program
on their system and see if they also get a segmentation violation
on the fopen of argv[1]. 

And if so, why?

#include <stdio.h>

struct abc
{
	short Red;
	short Green;
	short Blue;
	short Alpha;
};

main (argc, argv)
int argc; 
char **argv;
{
	FILE *f1, *fopen();

	struct abc point[151][451];

	if (argc !=2)
	{
	   puts("\n Usage: InputFileName \n");
	   exit(1);
	}

	if((f1 = fopen(argv[1], "r")) == NULL )
	{
	   printf("I can't open %s\n", argv[1]);
	   exit(1);
	}

	fclose(f1);
}

-------------------------------------------------------------

Thanks,
	Gene Guglielmo
        Naval Weapons Center
	sefunix at nwc-143b
------



More information about the Comp.unix.wizards mailing list