🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: net.notes
Article #149

newsinput hangs - (nf)

#149
From: johnl
Date: Thu, 04 Aug 1983 06:36
19 lines
909 bytes
#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
Technical Details
Message-ID: <369@ima.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!linus!decvax!cca!ima!johnl

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!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