🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: net.lang.c
Article #9567

How can this be broken ?!!?

#9567
From: Chris Sylvain
Date: Wed, 15 Oct 1986 19:01
20 lines
1264 bytes
This worked with Ultrix 1.2:
	while( fputc( fgetc(fd), fe) != EOF );
But is broken with 4.3BSD [!!] on the same microVAX ...
The char M-^? is written endlessly to the "fe" file.
M-^? means 8th bit set, lower 7 bits == ^? ...
<stdio.h> says: #define EOF (-1)
fputc and fgetc are int functions, and fgetc is supposed to return EOF
at the end of the file. I fixed my code by using feof(fd) ...
Am I right by saying the above code fragment by rights should still work ?

-- 
--==---==---==--
.. Long time the manxome foe he sought -- ..

ARPA: don@umd5.UMD.EDU     BITNET: don%umd5@umd2
UUCP: ..!{ seismo!umcp-cs, ihnp4!rlgvax }!cvl!umd5!don

** WARNING: don@mimsy.UMD.EDU is a different person **
** (umcp-cs and mimsy.umd.edu are the same machine) **
**   -->   Please double-check the address   <--    **
Technical Details
Message-ID: <1287@umd5>
Path: arc1-ca.pugleaf.net!utzoo!mnetor!seismo!umcp-cs!cvl!umd5!don

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!mnetor!seismo!umcp-cs!cvl!umd5!don
From: don@umd5 (Chris Sylvain)
Newsgroups: net.lang.c
Subject: How can this be broken ?!!?
Message-ID: <1287@umd5>
Date: Wed, 15-Oct-86 15:01:10 EDT
Article-I.D.: umd5.1287
Posted: Wed Oct 15 15:01:10 1986
Date-Received: Thu, 16-Oct-86 02:39:58 EDT
Organization: University of Maryland, College Park
Lines: 20
Keywords: EOF