wininet: Pass -1 into WideCharToMultiByte instead of calling
lstrlenW on the string to slightly reduce code size.
Alexandre Julliard
julliard at winehq.org
Thu May 24 10:28:19 CDT 2007
Robert Shearman <rob at codeweavers.com> writes:
> @@ -504,8 +504,8 @@ static BOOL HTTP_DoAuthorization( LPWININETHTTPREQW lpwhr, LPCWSTR pszAuthValue
>
> if (is_basic_auth_value(pszAuthValue))
> {
> - int userlen = WideCharToMultiByte(CP_UTF8, 0, domain_and_username, lstrlenW(domain_and_username), NULL, 0, NULL, NULL);
> - int passlen = WideCharToMultiByte(CP_UTF8, 0, password, lstrlenW(password), NULL, 0, NULL, NULL);
> + int userlen = WideCharToMultiByte(CP_UTF8, 0, domain_and_username, -1, NULL, 0, NULL, NULL);
> + int passlen = WideCharToMultiByte(CP_UTF8, 0, password, -1, NULL, 0, NULL, NULL);
This won't work, -1 is not equivalent to lstrlenW.
--
Alexandre Julliard
julliard at winehq.org
More information about the wine-devel
mailing list