All of lore.kernel.org
 help / color / mirror / Atom feed
* strncpy, strcat and memalign
@ 2010-08-01  0:10 Jon Grant
       [not found] ` <AANLkTimhujBTS5G_Q3BoFrVe1DKXsftrN14eMC5BD+di-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Jon Grant @ 2010-08-01  0:10 UTC (permalink / raw)
  To: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w; +Cc: linux-man-u79uwXL29TY76Z2rM5mHXA

Hello

I think these two man pages could be adjusted to use a consistent name
for "nul" terminators, that is '\0' in a const char * string.
http://linux.die.net/man/3/strncpy


this one consistently uses '\0'
http://linux.die.net/man/3/strcat

strncpy talks about '\0', "null-terminating", and "null byte"

IMHO "NUL" is the correct name to use, which is different again (N.B.
single L), compared to NULL (#define NULL (void*)0


Also this page seems to have lost formatting, this may only be the web
page generation though.


http://linux.die.net/man/3/memalign
Synopsis

#define _XOPEN_SOURCE 600#include <stdlib.h>
int posix_memalign(void **memptr, size_t alignment, size_t size);
#include <malloc.h>
void *valloc(size_t size);void *memalign(size_t boundary, size_t size);


See the #include is not on its own line after "XOPEN_SOURCE 600".
Likewise memalign should be on its own line.

Thank you for taking a look, 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: strncpy, strcat and memalign
       [not found] ` <AANLkTimhujBTS5G_Q3BoFrVe1DKXsftrN14eMC5BD+di-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2010-08-29  7:08   ` Michael Kerrisk
       [not found]     ` <AANLkTinYg=ke4ju2L+6aqGQNEvzB4JuomfFUrV9sRKkG-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Michael Kerrisk @ 2010-08-29  7:08 UTC (permalink / raw)
  To: Jon Grant; +Cc: linux-man-u79uwXL29TY76Z2rM5mHXA

Hello Jon,

On Sun, Aug 1, 2010 at 2:10 AM, Jon Grant <jg-hus3n9K41k0@public.gmane.org> wrote:
> Hello
>
> I think these two man pages could be adjusted to use a consistent name
> for "nul" terminators, that is '\0' in a const char * string.
> http://linux.die.net/man/3/strncpy

The HTML-rendered man pages at linux.die.net are created by someone
unknown to me. They are also years out of date.

For up-to-date HTML renderings, produced by me, see
http://www.kernel.org/doc/man-pages/online_pages.html

> this one consistently uses '\0'
> http://linux.die.net/man/3/strcat
>
> strncpy talks about '\0', "null-terminating", and "null byte"
>
> IMHO "NUL" is the correct name to use, which is different again (N.B.
> single L), compared to NULL (#define NULL (void*)0

(Take a look at up-to-date pages.)

I tend to avoid NUL, simply because it is so easy to visually confuse
with "NULL".

Other than that, I think the pages pretty consistently use '\0',
"terminating null byte", and "null-terminated string". I think this is
okay.

> Also this page seems to have lost formatting, this may only be the web
> page generation though.
>
>
> http://linux.die.net/man/3/memalign
> Synopsis
>
> #define _XOPEN_SOURCE 600#include <stdlib.h>
> int posix_memalign(void **memptr, size_t alignment, size_t size);
> #include <malloc.h>
> void *valloc(size_t size);void *memalign(size_t boundary, size_t size);
>
>
> See the #include is not on its own line after "XOPEN_SOURCE 600".
> Likewise memalign should be on its own line.

See comments above about the die.net pages.

Cheers,

Michael



> Thank you for taking a look, Jon
>



-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Author of "The Linux Programming Interface" http://blog.man7.org/
--
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: strncpy, strcat and memalign
       [not found]     ` <AANLkTinYg=ke4ju2L+6aqGQNEvzB4JuomfFUrV9sRKkG-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2010-08-30 10:45       ` Jon
  0 siblings, 0 replies; 3+ messages in thread
From: Jon @ 2010-08-30 10:45 UTC (permalink / raw)
  To: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w; +Cc: linux-man-u79uwXL29TY76Z2rM5mHXA

Hello Michael,

Thanks for your reply.

Michael Kerrisk wrote, On 29/08/10 08:08:
[.]
> The HTML-rendered man pages at linux.die.net are created by someone
> unknown to me. They are also years out of date.
> 
> For up-to-date HTML renderings, produced by me, see
> http://www.kernel.org/doc/man-pages/online_pages.html

Perfect! These are great. It is a shame those die.net are still 
comming up first on google "linux man strncpy".

I'll just refer to the your kernel.org link now.

[.]
> I tend to avoid NUL, simply because it is so easy to visually confuse
> with "NULL".
> 
> Other than that, I think the pages pretty consistently use '\0',
> "terminating null byte", and "null-terminated string". I think this is
> okay.

This looks great, very clear in these up to date man pages.

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:[~2010-08-30 10:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-01  0:10 strncpy, strcat and memalign Jon Grant
     [not found] ` <AANLkTimhujBTS5G_Q3BoFrVe1DKXsftrN14eMC5BD+di-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-08-29  7:08   ` Michael Kerrisk
     [not found]     ` <AANLkTinYg=ke4ju2L+6aqGQNEvzB4JuomfFUrV9sRKkG-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-08-30 10:45       ` Jon

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.