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=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HTML_MESSAGE,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 22005 invoked from network); 15 May 2020 20:06:02 -0000 Received: from minnie.tuhs.org (45.79.103.53) by inbox.vuxu.org with ESMTPUTF8; 15 May 2020 20:06:02 -0000 Received: by minnie.tuhs.org (Postfix, from userid 112) id 7BE6B9C694; Sat, 16 May 2020 06:06:00 +1000 (AEST) Received: from minnie.tuhs.org (localhost [127.0.0.1]) by minnie.tuhs.org (Postfix) with ESMTP id 283619C677; Sat, 16 May 2020 06:05:33 +1000 (AEST) Authentication-Results: minnie.tuhs.org; dkim=pass (1024-bit key; unprotected) header.d=ccc.com header.i=@ccc.com header.b="ilNnPrNK"; dkim-atps=neutral Received: by minnie.tuhs.org (Postfix, from userid 112) id B706F9C677; Sat, 16 May 2020 06:05:30 +1000 (AEST) Received: from mail-qk1-f170.google.com (mail-qk1-f170.google.com [209.85.222.170]) by minnie.tuhs.org (Postfix) with ESMTPS id 396A29C668 for ; Sat, 16 May 2020 06:05:30 +1000 (AEST) Received: by mail-qk1-f170.google.com with SMTP id 190so3961602qki.1 for ; Fri, 15 May 2020 13:05:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ccc.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=htqMbgRzkdeJn5ueeCxd7dHFh3kOvYBRj7hho1fp8Yc=; b=ilNnPrNKNuuESjNHyxr7lre0wJ3x1LRPMx8GcrUQiy3d5CyrdkPkeg0n8FkmDSAoCl 4rhod5Sps/3lI5tmxJrXtOoXD5Zlhi0oxKOKKPX7B5fWMhYNOZTw017lnViy2hGgRxVb Q4ZbxkHDl8wYw7oGV/nXPZ7oxgLKJxDVn5D5w= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=htqMbgRzkdeJn5ueeCxd7dHFh3kOvYBRj7hho1fp8Yc=; b=AJ0joRwQVff62wftiHMm5g9hs2kb5qbF+8A1K1zTl/TK44xi1rSIBdq3zoyVc4uzkv dVASbNm7D1kmt93chHwWM8A3ULqPqgsj3ml15WuRe3+QylSUit8q8knOIUtb0BUpf1dm IC7PKVCn/ZFf3mhg6sLcyGXfWGFjpEIJhRP8o4wQS3wzC/f2y1NUAStRCq2SckX+4Erd 7vuR4+aUL8OOxlNUAM9we+/kcMq7vKaBvXM6jZNDzdKNpFHmLKkbhUhfCXsMyZtrK+x6 t6n2HejBziuBoE545Fu7FWFzABBtBq/0ZcNH/Y0EfS/d+iSYrRxKNIIr28rUjEzsr2Vq oxkA== X-Gm-Message-State: AOAM530pb/B9j7Sgou1W7G239zsUDCY2ga9tdo1/zPmsAmJN0XALAgjx V3W/Y6MpxrxDim0ZQyN7nYOxHjj+j/xpDKwNse6rfg== X-Google-Smtp-Source: ABdhPJzDPSJMtJWvfa1WbAcAyXLvm8UiwLcCET89O7ftZIkZxXXaBOjRHiWS0sW+4DuK+KfLgQpGj4AS3oJNG/JFkKg= X-Received: by 2002:a37:a603:: with SMTP id p3mr4955500qke.133.1589573129177; Fri, 15 May 2020 13:05:29 -0700 (PDT) MIME-Version: 1.0 References: <202005141841.04EIfvEZ063529@tahoe.cs.Dartmouth.EDU> <20200515150122.GF30160@mcvoy.com> <014001d62af3$9cc209b0$d6461d10$@ronnatalie.com> In-Reply-To: <014001d62af3$9cc209b0$d6461d10$@ronnatalie.com> From: Clem Cole Date: Fri, 15 May 2020 16:05:02 -0400 Message-ID: To: Ronald Natalie Content-Type: multipart/alternative; boundary="000000000000b5a88605a5b5553a" 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: , Cc: The Eunuchs Hysterical Society Errors-To: tuhs-bounces@minnie.tuhs.org Sender: "TUHS" --000000000000b5a88605a5b5553a Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Ron, Hmmm... getchar/getc are defined as returning int in the man page and C is traditionally defined as an int in this code.. On Fri, May 15, 2020 at 4:02 PM wrote: > 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 re= cord is > now there */ > > > --000000000000b5a88605a5b5553a Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Ron,=C2=A0

Hmmm... getchar/getc ar= e defined as returning int in the man page and C is traditionally defined a= s an int in this code..

On Fri, May 15, 2020 at 4:02 PM <ron@ronnatalie.com> wrote:
<= blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-l= eft:1px solid rgb(204,204,204);padding-left:1ex">

Un= fortunately, 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.

=C2=A0

=C2=A0

=C2=A0

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

=C2=A0

--000000000000b5a88605a5b5553a--