WININET: implement InternetTime{From,To}SystemTime{A,W} (#4)

Hans Leidekker hans at it.vu.nl
Mon Jan 17 04:43:50 CST 2005


On Monday 17 January 2005 11:18, Joris Huizer wrote:

> > +    while (*s && !isalphaW( *s )) s++;
> > +    if (*s == '\0' || *(s + 1) == '\0' || *(s + 2) == '\0') return
> > FALSE; +    time->wDayOfWeek = 7;
> > +
> > +    for (i = 0; i < 7; i++)
> > +    {
> > +        if (toupperW( WININET_wkday[i][0] ) == toupperW( *s ) &&
> > +            toupperW( WININET_wkday[i][1] ) == toupperW( *(s + 1) ) &&
> > +            toupperW( WININET_wkday[i][2] ) == toupperW( *(s + 2) ) )
> > +        {
> > +            time->wDayOfWeek = i;
> > +            break;
> > +        }
> > +    }
>
> What happens if, the string ends with WININET_wkday[i][0] or
> WININET_wkday[i][1] ?

It can't, that's protected by the:

  if (*s == '\0' || *(s + 1) == '\0' || *(s + 2) == '\0') return FALSE

above. The third check prevents that.

> > +    if (time->wDayOfWeek > 6) return FALSE;
> > +    while (*s && !isdigitW( *s )) s++;
>
> What happens if s just became NULL in this loop ?

Huh?

> What happens if, the string ends with WININET_month[i][0] or
> WININET_month[i][1] ?

Same as above.

 -Hans



More information about the wine-devel mailing list