[PATCH 1/6] msvcrt: Rewrite asctime function

Alexandre Julliard julliard at winehq.org
Tue Apr 10 08:09:52 CDT 2012


Piotr Caban <piotr at codeweavers.com> writes:

> @@ -48,7 +49,7 @@ static const int MonthLengths[2][12] =
>  
>  static inline int IsLeapYear(int Year)
>  {
> -    return Year % 4 == 0 && (Year % 100 != 0 || Year % 400 == 0);
> +    return (Year % 4 == 0 && (Year % 100 != 0 || Year % 400 == 0)) ? 1 : 0;

Maybe you should do something like:

    return (((Year % 4 == 0 && (Year % 100 != 0 || Year % 400 == 0)) ? 1 : 0) ? 1 : 0) ? 1 : 0;

to make really sure you get 0 or 1, you never know what might happen ;-)

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list