linux-man.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Michael Kerrisk (man-pages)" <mtk.manpages@gmail.com>
To: Jonny Grant <jg@jguk.org>
Cc: linux-man <linux-man@vger.kernel.org>
Subject: Re: strcpy compared to POSIX strcpy
Date: Mon, 29 Jun 2020 22:30:48 +0200	[thread overview]
Message-ID: <CAKgNAkgH4L-_A0LqqYyk621EmRqDOqAbG80gR-bu4Fk6jcEskA@mail.gmail.com> (raw)
In-Reply-To: <0608691a-6400-0a44-1031-a693f57dee52@jguk.org>

Hi Jonny

On Mon, 29 Jun 2020 at 15:41, Jonny Grant <jg@jguk.org> wrote:
>
> Hi Michael,
>
> Returning to an old topic, noticed strcpy man page is different from the POSIX spec with regards to "terminating NUL character" or "null-terminated" shouldn't man pages should follow POSIX style writing "NUL"?
>
> https://man7.org/linux/man-pages/man3/strcpy.3.html
>
> https://man7.org/linux/man-pages/man3/strcpy.3p.html
>
> https://pubs.opengroup.org/onlinepubs/9699919799/functions/strcpy.html
>
> Another function even has nul in the name
> https://man7.org/linux/man-pages/man3/strchrnul.3.html

It's not so simple. In POSIX/SUS, you will find variously:

terminating NUL character
terminating NUL
terminating null character
terminating null byte

There's even one instance of "terminating NULL character" (in
<net/if.h>; I estimate it's a bug).

In the C standard (C11), "terminating null character" seems to be used
exclusively, but as I understand the C standard [char == byte] by
definition.

I've tried to consistently use "terminating null byte" across all
pages in man-pages. See also the discussion in man-pages(7).

Cheers,

Michael






-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

  reply	other threads:[~2020-06-29 20:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-29 13:41 strcpy compared to POSIX strcpy Jonny Grant
2020-06-29 20:30 ` Michael Kerrisk (man-pages) [this message]
2020-06-30 10:59   ` Jonny Grant

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAKgNAkgH4L-_A0LqqYyk621EmRqDOqAbG80gR-bu4Fk6jcEskA@mail.gmail.com \
    --to=mtk.manpages@gmail.com \
    --cc=jg@jguk.org \
    --cc=linux-man@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).