mirror of
https://github.com/aphrody-labs/PowerShell.git
synced 2026-10-17 12:45:47 +00:00
Use LOGIN_NAME_MAX instead of L_cuserid
Since L_cuserid is only for cuserid, not getlogin_r Unit test for L_cuserid removed because the macro may not be available on all platforms.
This commit is contained in:
1 parent
cbee353d0d
commit
9426e9c455
2 files changed
+5
-5
No files matched your search
@@ -43,8 +43,8 @@ BOOL GetUserName(WCHAR_T *lpBuffer, LPDWORD lpnSize)
|
||||
}
|
||||
|
||||
// Get username from system in a thread-safe manner
|
||||
char userName[L_cuserid];
|
||||
int err = getlogin_r(userName, L_cuserid);
|
||||
char userName[LOGIN_NAME_MAX];
|
||||
int err = getlogin_r(userName, LOGIN_NAME_MAX);
|
||||
// Map errno to Win32 Error Codes
|
||||
if (err != 0) {
|
||||
switch (errno) {
|
||||
|
||||
Reference in new issue
Block a user