wininet: Fully initialize a variable

Alexandre Julliard julliard at winehq.org
Thu Nov 8 05:15:52 CST 2007


"Juan Lang" <juan.lang at gmail.com> writes:

>  static void COOKIE_crackUrlSimple(LPCWSTR lpszUrl, LPWSTR hostName, int hostNameLen, LPWSTR path, int pathLen)
>  {
> -    URL_COMPONENTSW UrlComponents;
> +    URL_COMPONENTSW UrlComponents = { 0 };
>  
> -    UrlComponents.lpszExtraInfo = NULL;
> -    UrlComponents.lpszPassword = NULL;
> -    UrlComponents.lpszScheme = NULL;
>      UrlComponents.lpszUrlPath = path;
> -    UrlComponents.lpszUserName = NULL;
>      UrlComponents.lpszHostName = hostName;
>      UrlComponents.dwHostNameLength = hostNameLen;
>      UrlComponents.dwUrlPathLength = pathLen;

Please avoid that unportable array initialization syntax, and since the
code is already explicitly setting the fields you should simply add the
ones that are needed and missing.

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list