public inbox for linux-man@vger.kernel.org
 help / color / mirror / Atom feed
* Common way of explaining null-terminated strings
@ 2011-09-27 20:26 Jon Grant
       [not found] ` <4E823190.1070100-hus3n9K41k0@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Jon Grant @ 2011-09-27 20:26 UTC (permalink / raw)
  To: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w; +Cc: linux-man-u79uwXL29TY76Z2rM5mHXA

Hi Michael

I noticed there are a few different ways of explaining the 
null-terminating '\0' character.  Just thinking if this could be 
standardised, and the same description of this used across all the 
string functions (and wide string):

e.g.:

http://man7.org/linux/man-pages/online/pages/man3/strnlen.3.html

"terminating '\0' character"

and also:

"if there is no '\0' character"


My opinion would be that the phrase "null terminator '\0'" could be used 
for the first mention, and then later references could just say "if 
there is no null terminator".


To give an example of a page with a different way of explaining:

http://man7.org/linux/man-pages/online/pages/man3/strncat.3.html

"plus the terminating null byte"

http://man7.org/linux/man-pages/online/pages/man3/strcpy.3.html
"including the terminating null byte ('\0')"

"If there is no null byte"

Perhaps this could even be worth adding to the overview section:
http://man7.org/linux/man-pages/online/dir_section_7.html

Let me know what you think!

Best regards, Jon
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Common way of explaining null-terminated strings
       [not found] ` <4E823190.1070100-hus3n9K41k0@public.gmane.org>
@ 2011-09-28  5:41   ` Michael Kerrisk
       [not found]     ` <CAKgNAkh+FZxN_3PnbFx5oEnTLg-qLiz45GXMKSHVxrWmM195Hg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Michael Kerrisk @ 2011-09-28  5:41 UTC (permalink / raw)
  To: Jon Grant; +Cc: linux-man-u79uwXL29TY76Z2rM5mHXA

Hi Jon,

On Tue, Sep 27, 2011 at 10:26 PM, Jon Grant <jg-hus3n9K41k0@public.gmane.org> wrote:
> Hi Michael
>
> I noticed there are a few different ways of explaining the null-terminating
> '\0' character.

Yes. There is some inconsistency.

> Just thinking if this could be standardised, and the same
> description of this used across all the string functions (and wide string):

A good idea.

> e.g.:
>
> http://man7.org/linux/man-pages/online/pages/man3/strnlen.3.html
>
> "terminating '\0' character"
>
> and also:
>
> "if there is no '\0' character"
>
>
> My opinion would be that the phrase "null terminator '\0'" could be used for
> the first mention, and then later references could just say "if there is no
> null terminator".
>
> To give an example of a page with a different way of explaining:
>
> http://man7.org/linux/man-pages/online/pages/man3/strncat.3.html
>
> "plus the terminating null byte"
>
> http://man7.org/linux/man-pages/online/pages/man3/strcpy.3.html
> "including the terminating null byte ('\0')"
>
> "If there is no null byte"
>
> Perhaps this could even be worth adding to the overview section:
> http://man7.org/linux/man-pages/online/dir_section_7.html

The preferred terms (more or less following POSIX) are

"terminating null byte" (and terminating null wide character")
and
"null-terminated string"

I've made a pass through the pages, bringing more consistency.
Ideally, the first instance of "terminating null byte" on most pages
also now includes mention of '\0'.

Take a look through git (or man-pages-3.35 when it comes out).

Cheers,

Michael

-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Author of "The Linux Programming Interface"; http://man7.org/tlpi/
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Common way of explaining null-terminated strings
       [not found]     ` <CAKgNAkh+FZxN_3PnbFx5oEnTLg-qLiz45GXMKSHVxrWmM195Hg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2011-09-28 21:59       ` Jon Grant
  0 siblings, 0 replies; 3+ messages in thread
From: Jon Grant @ 2011-09-28 21:59 UTC (permalink / raw)
  To: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w; +Cc: linux-man-u79uwXL29TY76Z2rM5mHXA

Hi,

Michael Kerrisk wrote, On 28/09/11 06:41:
[..]
> I've made a pass through the pages, bringing more consistency.
> Ideally, the first instance of "terminating null byte" on most pages
> also now includes mention of '\0'.
>
> Take a look through git (or man-pages-3.35 when it comes out).

Excellent, thank you for making the updates. I'll take a look when it is 
out.

Best regards, Jon
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-09-28 21:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-27 20:26 Common way of explaining null-terminated strings Jon Grant
     [not found] ` <4E823190.1070100-hus3n9K41k0@public.gmane.org>
2011-09-28  5:41   ` Michael Kerrisk
     [not found]     ` <CAKgNAkh+FZxN_3PnbFx5oEnTLg-qLiz45GXMKSHVxrWmM195Hg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-09-28 21:59       ` Jon Grant

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox