(try 2) ws2_32: getsockname should fail for unbound sockets

Dmitry Timoshkov dmitry at codeweavers.com
Wed May 30 23:09:51 CDT 2007


"Damjan Jovanovic" <damjan.jov at gmail.com> wrote:

> +        case AF_INET6:
> +        {
> +            static const struct sockaddr_in6 emptyAddr;
> +            const struct sockaddr_in6 *in6 = (struct sockaddr_in6*) uaddr;
> +            return in6->sin6_port || memcmp(&in6->sin6_addr, &emptyAddr.sin6_addr, sizeof(struct in6_addr));
> +        }
> +        case AF_INET:
> +        {
> +            static const struct sockaddr_in emptyAddr;
> +            const struct sockaddr_in *in = (struct sockaddr_in*) uaddr;
> +            return in->sin_port || memcmp(&in->sin_addr, &emptyAddr.sin_addr, sizeof(struct in_addr));
> +        }

You should add 'const' to the casting if the target you create is 'const'.

-- 
Dmitry.



More information about the wine-devel mailing list