Bug 422788 - reduce ambiguous wide/narrow char windows api calls in toolkit

This commit is contained in:
Brad Lassey 2008-07-07 18:57:08 -04:00
parent af375d4358
commit b46984e309

View File

@ -58,14 +58,13 @@ nsUserInfo::GetUsername(char **aUsername)
{
*aUsername = nsnull;
TCHAR username[256];
PRUnichar username[256];
DWORD size = 256;
if (!GetUserName(username, &size))
if (!GetUserNameW(username, &size))
return NS_ERROR_FAILURE;
*aUsername = nsCRT::strdup(username);
*aUsername = ToNewUTF8String(nsDependentString(username));
if (*aUsername) return NS_OK;
return NS_ERROR_FAILURE;