Unix problem or C problem?

Mark A. Heilpern heilpern at ibd.BRL.MIL
Tue Jan 17 23:57:01 AEST 1989


	HELPHELPHELPHELPHELPHELPHELPHELPHELPHELPHELPHELP

	When running a program with the following code:

	while (fscanf(input,"%d",stars)!=EOF) {
		fprintf(stderr,"OK to this point.\n");
		fprintf(output,"%4d |",lines++);
		stars /= 50;
		for (count = 0; count <= stars; count++)
			fprintf(output,"*");
		fprintf(output,"\n");
	}

	I get the following error message, NOT put out from my program:

PROTECTION VIOLATION: name='plot', pid=15943, pc=a410cdc, ps=80000180
Illegal instruction

	Although this section of code indicates otherwise, I am using
	standard input and output. The "OK to this point" message does
	not appear when put in this position, however it does when placed
	one line above. (Still giving the error message :)

	The 'plot' program is not setu/gid, I've never seen a PROTECTION
	VIOLATION error like this before. Any insights would be greatly
	appreciated.

		Mark A. Heilpern, heilpern at brl.mil
-- 
 |\/|         |
 |  |   _     |<
/    \_(_(_)\_/ \______



More information about the Comp.unix.wizards mailing list