Use just LOGIN_NAME_MAX
The +1 is unnecessary since LOGIN_NAME_MAX includes null.
This commit is contained in:
parent
db7117bd47
commit
674ca43046
1 changed files with 1 additions and 1 deletions
|
@ -116,7 +116,7 @@ BOOL GetUserNameW(WCHAR_T* lpBuffer, LPDWORD lpnSize)
|
|||
}
|
||||
|
||||
// Convert to char* to WCHAR_T* (UTF-8 to UTF-16 LE w/o BOM)
|
||||
std::basic_string<char16_t> username16(LOGIN_NAME_MAX+1, 0);
|
||||
std::basic_string<char16_t> username16(LOGIN_NAME_MAX, 0);
|
||||
icu::UnicodeString username8(username.c_str(), "UTF-8");
|
||||
int32_t targetSize = username8.extract(0, username8.length(),
|
||||
reinterpret_cast<char*>(&username16[0]),
|
||||
|
|
Loading…
Reference in a new issue