On Friday, 19 Dec 2014 06:45:57 -0800, Chris Robinson wrote:
> Special-casing buff=NULL size=0 sounds like MS's attempt to add a bit
> more C99 compliance to the (v)snprintf functions, in addition to adding
> more C99 functions in general, which they've been talking about the last
> couple of years. This behavior may be different from older pre-VS2013
> versions.
I ran the same tests earlier today using VS2008 and VS2010, and I got the same results. Both vsnprintf and _vsnwprintf behave the same way.
I added two tests to dlls/msvcrt/tests/printf.c (not sure if that was the correct place) and submitted the diff to the testbot.
[1] https://testbot.winehq.org/JobDetails.pl?Key=10842
[2] https://testbot.winehq.org/JobDetails.pl?Key=10843
The tests pass on all VMs, except for W2000. That OS fails when calling vsnprintf(NULL, 0, fmt, args).
ret = _vsnwprintf_wrapper( NULL, 0, format, one, two, three );
ok( ret == 11, "got %d, expected 11\n", ret );
What's the best way to handle the different return value in Wine tests?
ok( ret == 11 || ret == -1, "got %d, expected 11\n", ret );