Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: utzoo!linus!decvax!cca!ima!johnl
From: johnl@ima.UUCP
Newsgroups: net.notes
Subject: newsinput hangs - (nf)
Message-ID: <369@ima.UUCP>
Date: Thu, 4-Aug-83 02:36:58 EDT
Article-I.D.: ima.369
Posted: Thu Aug  4 02:36:58 1983
Date-Received: Thu, 4-Aug-83 11:36:05 EDT
Lines: 19

#N:ima:18500001:000:483
ima!johnl    Aug  3 21:43:00 1983

I noticed that the "newsinput" program here was getting hung a lot, and
inspection shows many places in the code like:

	while(getchar() != '\n')
		;

If the note got truncated so that the header is incomplete, this sort of
code hangs up.  Tsk, tsk.  The fix is easy.  In all such places, change
the code to something like this:

	while(getchar() != '\n')
		if(feof(stdin))
			exit(1);

John Levine, decvax!yale-co!ima!johnl, ucbvax!cbosgd!ima!johnl,
{allegra|floyd|amd70}!ima!johnl