Use just LOGIN_NAME_MAX

The +1 is unnecessary since LOGIN_NAME_MAX includes null.
This commit is contained in:
Andrew Schwartzmeyer
2015-08-13 20:32:30 -07:00
parent c6aa25acd5
commit fd8352c469
+1 -1
View File
@@ -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]),