From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HTML_MESSAGE,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 21510 invoked from network); 15 May 2020 20:02:06 -0000 Received: from minnie.tuhs.org (45.79.103.53) by inbox.vuxu.org with ESMTPUTF8; 15 May 2020 20:02:06 -0000 Received: by minnie.tuhs.org (Postfix, from userid 112) id AB9389C95E; Sat, 16 May 2020 06:02:01 +1000 (AEST) Received: from minnie.tuhs.org (localhost [127.0.0.1]) by minnie.tuhs.org (Postfix) with ESMTP id 1E36C9C69A; Sat, 16 May 2020 06:01:29 +1000 (AEST) Authentication-Results: minnie.tuhs.org; dkim=fail reason="signature verification failed" (1024-bit key; secure) header.d=mxes.net header.i=@mxes.net header.b="AFR0WGvS"; dkim-atps=neutral Received: by minnie.tuhs.org (Postfix, from userid 112) id 507AC9C69A; Sat, 16 May 2020 06:01:27 +1000 (AEST) Received: from smtp-out-3.mxes.net (smtp-out-3.mxes.net [198.205.123.68]) by minnie.tuhs.org (Postfix) with ESMTPS id 827659C694 for ; Sat, 16 May 2020 06:01:26 +1000 (AEST) Received: from Customer-MUA (mua.mxes.net [10.0.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.mxes.net (Postfix) with ESMTPSA id D0A19759AB for ; Fri, 15 May 2020 16:01:24 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mxes.net; s=mta; t=1589572885; bh=kXBzwe0apv54zJcTa4OMATBQkkZ+2IRpBVtgEnrcNvI=; h=From:To:References:In-Reply-To:Subject:Date:Message-ID: MIME-Version:Content-Type; b=AFR0WGvSevkNIGR2pJ2v4kXscU47crNdkAG5acUHzCZ2Q9QVGbgBTPGmPqVx2FvL+ heXvD8Zbr3lU7i4sm1UkElyOnpMi2Ne+spF5BcNtxEOP7OUbam2FWTGQx6ZuSkQKMJ 5y743KYKblRfnw7ylqx5DA+oi7WdgUzr0Y/gU0FY= From: To: References: <202005141841.04EIfvEZ063529@tahoe.cs.Dartmouth.EDU> <20200515150122.GF30160@mcvoy.com> In-Reply-To: Date: Fri, 15 May 2020 16:01:23 -0400 Message-ID: <014001d62af3$9cc209b0$d6461d10$@ronnatalie.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0141_01D62AD2.15B0DEE0" X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQG9ANzJLoUOr1G01nr91LNGaadNcQF8gWPuAmIHo/ECCfy4nAGrFaSRqJ9IHSA= Content-Language: en-us X-Sent-To: Subject: Re: [TUHS] v7 K&R C X-BeenThere: tuhs@minnie.tuhs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: The Unix Heritage Society mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: tuhs-bounces@minnie.tuhs.org Sender: "TUHS" This is a multipart message in MIME format. ------=_NextPart_000_0141_01D62AD2.15B0DEE0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Unfortunately, if c is char on a machine with unsigned chars, or = it=E2=80=99s of type unsigned char, the EOF will never be detected. =20 =20 =20 * while ((c =3D getchar()) !=3D EOF) if (c =3D=3D '\n') { /* entire = record is now there */ =20 ------=_NextPart_000_0141_01D62AD2.15B0DEE0 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Unfortunately, if c is char on a machine with unsigned = chars, or it=E2=80=99s of type unsigned char, the EOF will never be = detected.

 

 

 

  • while ((c =3D getchar()) !=3D EOF) if (c =3D=3D = '\n') { /* entire record is now there */

 

=
------=_NextPart_000_0141_01D62AD2.15B0DEE0--