Commit d3c86f61 authored by Edric Milaret's avatar Edric Milaret Committed by gerrit2
Browse files

sip: fix username truncated on win32

- TCHAR conversion to std::string wasn't working

Change-Id: I8fa9a634f50a58515a0ba49be99dd166a0a537b3
Tuleap: #133
parent fa04627a
......@@ -1311,7 +1311,12 @@ std::string SIPAccount::getLoginName()
#else
TCHAR username[UNLEN + 1];
DWORD size = UNLEN + 1;
return GetUserName((TCHAR*)username, &size) ? std::string((char*)username) : "";
std::string uname;
if (GetUserName((TCHAR*)username, &size)) {
std::wstring wStr = username;
uname = std::string(wStr.begin(), wStr.end());
}
return uname;
#endif
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment