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:
Andrew Schwartzmeyer committed 2015-08-03 13:00:34 -07:00
1 parent cbee353d0d
commit 9426e9c455
2 files changed
+5 -5

No files matched your search

+2 -2
View File
@@ -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) {