On Mo, 2007-05-21 at 14:28 +0100, Robert Shearman wrote:
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);
What is the advantage to use lstrlenW() here over -1, as used below?
WideCharToMultiByte(CP_UTF8, 0, domain_and_username, -1,
auth_data, userlen, NULL, NULL);
auth_data[userlen] = ':';
WideCharToMultiByte(CP_UTF8, 0, password, -1,
&auth_data[userlen+1], passlen, NULL, NULL);
Using -1 has the advantage to reduce the code-size.
Thanks.