[PATCH] msvcrt/tests: Add tests for mbstowcs and wcstombs with a negative count.

Alex Henrie alexhenrie24 at gmail.com
Tue Jun 14 13:01:12 CDT 2016


2016-06-14 4:12 GMT-06:00 Piotr Caban <piotr.caban at gmail.com>:
> On 06/14/16 06:18, Alex Henrie wrote:
>>
>> I just ran some more tests, and it turns out that the behavior of
>> Vista and later is even weirder than I thought. On these systems,
>> mbstowcs with a negative count writes one null byte to the output
>> string before returning -1, but wcstombs returns -1 without writing
>> anything.
>>
>> I think I'd rather have the Windows XP / standard C behavior than the
>> inconsistent, nonconformant Vista behavior.
>
>
> I've moved your tests to msvcr90. The behavior is consistent there on all
> windows versions. I think it makes the tests easier to read. I've also
> changed the implementation so all tests are passing.

It looks like you chose the Windows Vista behavior. That's fine, at
least we match some version of Windows now.

Interestingly, somehow this change fixed the Emergency 3 Demo. That's
a pleasant surprise, I thought that the problem was going to be more
complicated :-D

-Alex



More information about the wine-devel mailing list