[prev in list] [next in list] [prev in thread] [next in thread] 

List:       wine-devel
Subject:    Re: [PATCH 2/2] winhttp: Also pass hostname to jsproxy
From:       Nikolay Sivov <bunglehead () gmail ! com>
Date:       2016-08-31 20:08:30
Message-ID: 908f2e4d-4f2d-a712-7df7-d87ce29bd21a () gmail ! com
[Download RAW message or body]

On 31.08.2016 22:21, Andrew Eikum wrote:
>  
> +static inline char *strdupWA_sized( const WCHAR *src, DWORD size )
> +{
> +    char *dst = NULL;
> +    if (src)
> +    {
> +        int len = WideCharToMultiByte( CP_ACP, 0, src, size, NULL, 0, NULL, NULL ) + 1;
> +        if ((dst = heap_alloc( len )))
> +        {
> +            WideCharToMultiByte( CP_ACP, 0, src, len, dst, size, NULL, NULL );
> +            dst[len - 1] = 0;
> +        }
> +    }
> +    return dst;
> +}
> +

This is usually called strndup* in Wine dlls. Also 'len' and 'size' seem
to be misplaced, and I'm not sure it will do the right thing if for
negative size, unless it's not meant to ever be negative.



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic