This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [libstdc++] Transforming a string to a primary sort key


On Fri, Mar 28, 2014 at 4:31 PM, Andreas Schwab <schwab@linux-m68k.org> wrote:
> Tim Shen <timshen91@gmail.com> writes:
>
>>     int n1 = wcsxfrm(buff1, st1, wcslen(st1));
>
> This is not the length of the string, but the max size of the output.
> Since the output is truncated you are getting unspecified contents.

Oh, thanks, that's a quite stupid mistake. So I use "sizeof(buff1)"
and "sizeof(buff2)" respectively and get the result 1 from wcscmp and
7 from wcscoll, which is correct.

That does give an example that wcsxfrm is not what transform_primary
wants, which expect a 0 as a return.


-- 
Regards,
Tim Shen


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]