[Bug 5884] VB6 application fails to convert date to string formatted weekdays

wine-bugs at winehq.org wine-bugs at winehq.org
Sun Dec 2 07:20:08 CST 2007


http://bugs.winehq.org/show_bug.cgi?id=5884





--- Comment #16 from Alex Balut <alexandru.balut at gmail.com>  2007-12-02 07:20:07 ---
(In reply to comment #15)
> > localeValue += (iWeekday - 1 + iFirstDay - 1) % 7
> 
> But this would return monday for iFirstday==1 and iWeekday==1,
> wouldn't it? If yes, it's wrong, it should be sunday.

Yes, I discovered that by running the test on W2000.. I used the information on
this page: http://msdn2.microsoft.com/en-us/library/ms221315.aspx but it is
wrong, the value "1" for iFirstDay means Sunday, as you say, not Monday. The
explanation for iWeekday also does not make sense, as "1" should be "the first
day of the week", not "Monday", or anything else..

> > I had doubts about having both the function and the 
> > function test on the same calls but I'll extend the test, 
> > better be safe.
> 
> They are (hopefully) tested elsewhere, so it should be OK.

I think the test is now much more solid, I'll post the patch as soon as I
figure how to use git. :)

> +    if (buff) WideCharToMultiByte(...); \
> +    else buff[0] = '\0'; \
> 
> This is suspicious. If you called this with buff==0 (although you
> don't) it would write to address 0.

Yes, I fixed that.


-- 
Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.



More information about the wine-bugs mailing list