Re: msvcrt: Add implementation of _strncoll

2010-11-17 Thread Piotr Caban
On 11/17/10 15:14, Vitaly Perov wrote: On Monday 15 November 2010 17:16:32 Piotr Caban wrote: On 11/15/10 14:53, Vitaly Perov wrote: This function should be implemented without memory allocations. Why? I don't think it is possible to implement it without any memory allocations. I mean witho

Re: msvcrt: Add implementation of _strncoll (try 2)

2010-11-17 Thread Dmitry Timoshkov
Vitaly Perov wrote: > +result = strcoll(nstr1, nstr2); System strcoll() for strings in different encoding won't work properly. -- Dmitry.

Re: msvcrt: Add implementation of _strncoll

2010-11-17 Thread Vitaly Perov
On Monday 15 November 2010 17:16:32 Piotr Caban wrote: > On 11/15/10 14:53, Vitaly Perov wrote: > >> This function should be implemented without memory allocations. > > > > Why? I don't think it is possible to implement it without any memory > > allocations. > > I mean without copying the strings.

Re: msvcrt: Add implementation of _strncoll

2010-11-15 Thread Piotr Caban
On 11/15/10 14:53, Vitaly Perov wrote: This function should be implemented without memory allocations. Why? I don't think it is possible to implement it without any memory allocations. I mean without copying the strings. Using strcoll doesn't make much sense (here and in MSVCRT_strcoll implem

Re: msvcrt: Add implementation of _strncoll

2010-11-15 Thread Vitaly Perov
Hi, Thank you very much for your answer! > strncoll is used to compare at most count characters (you can't access > data after nullbyte). You're not null terminating nstr1 and nstr2 strings. > Yes, I forgott this. Thank you. > This function should be implemented without memory allocations. Why? I

Re: msvcrt: Add implementation of _strncoll

2010-11-15 Thread Piotr Caban
Hi, +char * nstr1 = HeapAlloc(GetProcessHeap(), 0, count + 1); +char * nstr2 = HeapAlloc(GetProcessHeap(), 0, count + 1); + +memcpy(nstr1, str1, count + 1); strncoll is used to compare at most count characters (you can't access data after nullbyte). You're not null terminating nstr1