Farid Zaripov wrote:
 > -----Original Message-----
 > From: Martin Sebor [mailto:[EMAIL PROTECTED]
 > Sent: Thursday, October 05, 2006 6:59 PM
 > To: [email protected]
 > Subject: Re: [PATCH] STDCXX-93
 >
 > We should either pass in the size of the destination buffer
 > or some large value that windows can deal with.

First, I have made this, but then I had seen the first mbstowcs() call with length of source string in the size and changed by analogy.

  New patch is attached.

This looks correct to me.

Just one request regarding formatting:

[...]
@@ -804,9 +805,9 @@
         // (at an appropriately aligned offset) and set its offset
         const char *str =
             _RWSTD_STATIC_CAST (const char*, pun->abmon (t.tm_mon, 0));
-
         wchar_t *pwbuf = _RWSTD_REINTERPRET_CAST (wchar_t*, pbuf + off);
-        _RWSTD_SIZE_T size = mbstowcs (pwbuf, str, _RWSTD_SIZE_MAX);
+        _RWSTD_SIZE_T size = mbstowcs (pwbuf, str,
+            (bufsize - off) / sizeof (*pwbuf));

The style of indentation we've been following breaks the statement
above either after the equals sign

    _RWSTD_SIZE_T size =
        mbstowcs (pwbuf, str, (bufsize - off) / sizeof *pwbuf);

or (IMHO, less preferably) indents the function arguments on the
next lines to begin in the same column as the first argument on
the first line.

    _RWSTD_SIZE_T size = mbstowcs (pwbuf, str,
                                   (bufsize - off) / sizeof *pwbuf);

The goal is to use indentation to group subexpression according
to their role in the complete expression or statement to help
readability.

Martin

Reply via email to