On Thu, Mar 19, 2015 at 03:59:44PM +0200, Kaspars Bankovskis wrote:
> On Thu, Mar 19, 2015 at 01:36:45PM +0001, Jason McIntyre wrote:
> > On Thu, Mar 19, 2015 at 03:32:52PM +0200, Kaspars Bankovskis wrote:
> > > Is that really accurate to say that elements are stored in a pointer?
> > > 
> > 
> > no idea. it's why i asked stsp to look it over.
> > jmc

It's not technically accurate. Regardless, anyone who can read
C function declarations will grok the intended meaning.

Some man pages use the 'pointed to by' wording for pointer variables,
e.g. read(2), write(2), fseek(3). Some do not, e.g. string functions
like memset(3) and strlcpy(3).

Shrug. I don't think arguing about this is worth anyone's time.

> It's just that the previous sentence in those manuals is still about
> "..array pointed to by pwcs". And now the next sentence says that
> something is stored *in* pwcs, which imho doesn't sound quite consistenly.

I agree here. That wasn't apparent from the context of the diff.
I didn't read the entire page.

Perhaps the following diff would make everyone happy again?

Index: mbstowcs.3
===================================================================
RCS file: /cvs/src/lib/libc/locale/mbstowcs.3,v
retrieving revision 1.6
diff -u -p -r1.6 mbstowcs.3
--- mbstowcs.3  19 Mar 2015 12:41:51 -0000      1.6
+++ mbstowcs.3  19 Mar 2015 14:54:15 -0000
@@ -39,16 +39,12 @@
 .Fn mbstowcs "wchar_t * restrict pwcs" "const char * restrict s" "size_t n"
 .\" ----------------------------------------------------------------------
 .Sh DESCRIPTION
-The
 .Fn mbstowcs
 converts a null-terminated multibyte character string pointed to by
 .Fa s
-to the corresponding wide-character string and stores it in the array
-pointed to by
-.Fa pwcs .
-Up to
+to the corresponding wide-character string and stores up to
 .Fa n
-elements are stored in
+wide characters in the array pointed to by
 .Fa pwcs .
 Each character will be converted as if
 .Xr mbtowc 3
Index: wcrtomb.3
===================================================================
RCS file: /cvs/src/lib/libc/locale/wcrtomb.3,v
retrieving revision 1.8
diff -u -p -r1.8 wcrtomb.3
--- wcrtomb.3   19 Mar 2015 12:41:51 -0000      1.8
+++ wcrtomb.3   19 Mar 2015 14:51:10 -0000
@@ -42,16 +42,13 @@
 .Fn wcrtomb
 converts the wide character given by
 .Fa wc
-to the corresponding multibyte character, and stores it in the array
-pointed to by
+to the corresponding multibyte character, and stores up to
+.Dv MB_CUR_MAX
+bytes in the array pointed to by
 .Fa s
-unless
+if 
 .Fa s
-is a null pointer.
-Up to
-.Dv MB_CUR_MAX
-bytes are stored in
-.Fa s .
+is not a null pointer.
 .Pp
 The behaviour of
 .Fn wcrtomb
Index: wcstombs.3
===================================================================
RCS file: /cvs/src/lib/libc/locale/wcstombs.3,v
retrieving revision 1.6
diff -u -p -r1.6 wcstombs.3
--- wcstombs.3  19 Mar 2015 12:41:51 -0000      1.6
+++ wcstombs.3  19 Mar 2015 14:53:30 -0000
@@ -43,11 +43,9 @@
 converts the null-terminated wide-character string pointed to by
 .Fa pwcs
 to the corresponding multibyte character string,
-and stores it in the array pointed to by
-.Fa s .
-Up to
+and stores up to
 .Fa n
-bytes are stored in
+bytes in the array pointed to by
 .Fa s .
 Each character will be converted as if
 .Xr wctomb 3

Reply via email to