This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: strxfrm() returns an incorrect value on a short buffer
- From: Tony Cook <tony at develop-help dot com>
- To: cygwin at cygwin dot com
- Date: Wed, 13 Apr 2016 10:46:28 +1000
- Subject: Re: strxfrm() returns an incorrect value on a short buffer
- Authentication-results: sourceware.org; auth=none
- References: <20160412050722 dot GE12445 at mars dot tony dot develop-help dot com> <20160412133049 dot GN9870 at calimero dot vinschen dot de>
On Tue, Apr 12, 2016 at 03:30:49PM +0200, Corinna Vinschen wrote:
> On Apr 12 15:07, Tony Cook wrote:
> > strxfrm() returns an incorrect value if you supply an output buffer
> > and that buffer is too short for the result.
> >
> > With the code following:
> > [...]
> > It appears that strxfrm() is just returning the size of the output
> > buffer on an overflow error rather than calling LCMapString() again
> > with cchDest set to zero to get the required buffer length that
> > strxfrm() is meant to return on a short buffer.
>
> Thanks for the testcase. I applied a patch
>
> https://sourceware.org/git/?p=newlib-cygwin.git;h=e1854211
>
> and created new snapshots on
>
> https://cygwin.com/snapshots/
>
> Please give them a try.
Thanks, fixed in snapshot 20160412.
Tony
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple