Mail Archives: cygwin-developers/2001/10/23/13:10:30
On Tue, Oct 23, 2001 at 03:27:24PM +1000, Robert Collins wrote:
>and this patch fixes it.
>
>Index: fhandler_console.cc
>===================================================================
>RCS file: /cvs/src/src/winsup/cygwin/fhandler_console.cc,v
>retrieving revision 1.66
>diff -u -p -r1.66 fhandler_console.cc
>--- fhandler_console.cc 2001/10/22 18:39:22 1.66
>+++ fhandler_console.cc 2001/10/23 05:23:17
>@@ -54,7 +54,7 @@ cp_convert (UINT destcp, char * dest, UI
> }
> else
> {
>- WCHAR wbuffer[CONVERT_LIMIT]; /* same size as the maximum input,
>s.b. */
>+ WCHAR *wbuffer = (WCHAR *) alloca (CONVERT_LIMIT); /* same size
>as the maximum inpu
>t, s.b. */
> if (!MultiByteToWideChar (srccp, 0, src, size, wbuffer, sizeof
>(wbuffer)))
> return FALSE;
> if (!WideCharToMultiByte (destcp, 0, wbuffer, size, dest, size,
>
>Have fun!
Aren't you potentially doing that assignment in a loop? If this is inlined,
I wonder if gcc does the right thing.
cgf
- Raw text -