advpack:reg.c: Cast-qual warning fix

Alexandre Julliard julliard at winehq.org
Mon Aug 28 11:47:13 CDT 2006


Andrew Talbot <Andrew.Talbot at talbotville.com> writes:

> --- a/dlls/advpack/reg.c	2006-06-14 12:55:31.000000000 +0100
> +++ b/dlls/advpack/reg.c	2006-08-28 17:00:18.000000000 +0100
> @@ -255,11 +255,14 @@
>      /* FIXME: read AdvOptions val for dwFlags */
>      ZeroMemory(&cabinfo, sizeof(CABINFOW));
>      cabinfo.pszInf = tmp_ini_path;
> -    cabinfo.pszSection = (LPWSTR)pszSection;
> +    cabinfo.pszSection = HeapAlloc(GetProcessHeap(), 0, (lstrlenW(pszSection) + 1) * sizeof(WCHAR));
> +    lstrcpyW(cabinfo.pszSection, pszSection);
>      cabinfo.dwFlags = 0;

I don't think we want to duplicate strings just because of the
warning. If the string really needs to be writable sure, but if it's
just because of MS broken prototypes it's not worth the extra cost.

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list