Re: Errata in K&R C v2, page 97 (was: [PATCH v2] CONTRIBUTING: Please sign your emails with PGP)

Brian Kernighan
2023-11-26T15:28:40Z

[-- Attachment #1: Type: text/plain, Size: 1220 bytes --]

In the printed version of the C book, section 5.5 begins on page 104.
pmessage is indeed the one with two boxes and an arrow.

Are you looking at the real book or some mutated copy from the web?
I have had error reports in the past on imperfectly pirated copies.

On Wed, 22 Nov 2023, Alejandro Colomar wrote:

> Hello Brian,
>
>> On Wed, Nov 22, 2023 at 10:25:57AM -0600, G. Branden Robinson wrote:
>>> [1] I encourage anyone with either a reverential or heretical turn of
>>> mind to review §5.5 of the 2nd edition of _The C Programming
>>> Language_ and consider it light of our string_copying(7)
>>> discussions. I would attend particularly to what is implied by the
>>> recommendation of Exercise 5-5 to implement strncat(3), strncmp(3),
>>> and strncpy(3) from scratch.
>
> I just found an erratum in K&R C v2 §5.5: In page 97, in the picture,
> 'amessage' and 'pmessage' are switched (IMO); pmessage should be the one
> with the two boxes and an arrow, since it's the pointer one. We didn't
> find it in the existing list of errata[1], which Branden pointed to me.
>
> [1]: <https://www.cs.princeton.edu/~bwk/cbook.html>
>
> Cheers,
> Alex
>
> --
> <https://www.alejandro-colomar.es/>
>