[comp.lang.c] Extra characters printing to screen when exit

duvalj@bionette.cgrb.orst.edu (Joe Duval - Entomology) (07/03/90)

Hi,
  I am working on a Turbo C on a 386 clone.  The program I am working on
was started by someone else and I have been selected to do the finishing 
up type of work so I don't know all of the nooks and crannies of the 
program.

Here is the problem:  To exit the program one selects EXIT from a menu.  This
calls a function that does some clean up work and calls exit() to stop the
program.  (see code below)  The code passed to the function is passed to 
exit().  What consistently happens is that extra characters are printed after
the "Hey, that was great." line.  I am assuming that it is a result of exit()
clearing internal buffers.  

My questions:  First, am I right about it coming from exit() clearing buffers?
Second, why are there unflushed internal buffers and where could I find the
culprit?  Third, is there a way to either manually clear these buffers without
knowing where they were filled or, suppressing what exit() prints to the
screen (assuming it is a big task to find the culprit)?

****** Exit program function
	void SeeYa(code)
	int code;
	{
       		 fcloseall();
		 clrscr();
       	         printf ("\n\nHey, that was great.\n");
       		 exit(code);
	}

Thanks for any help
-Joe
--
duvalj@bionette.cgrb.orst.edu           | Life is a tragedy for those that feel
Phone: (503) 929-2556  (Philomath, OR)  | and a comedy for those that think!