Cleanup
Signed-off-by: Simon Rozman <simon@rozman.si>
This commit is contained in:
parent
40003c4054
commit
ca4e9d069f
@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
SPDX-License-Identifier: MIT
|
||||
Copyright © 1991-2023 Amebis
|
||||
Copyright © 2016 GÉANT
|
||||
|
@ -1056,7 +1056,7 @@ namespace winstd
|
||||
}
|
||||
|
||||
///
|
||||
/// Returns the Windows error number
|
||||
/// Returns the error number
|
||||
///
|
||||
error_type number() const
|
||||
{
|
||||
|
@ -31,7 +31,7 @@ static BOOLEAN GetUserNameExA(_In_ EXTENDED_NAME_FORMAT NameFormat, _Inout_ std:
|
||||
// Copy from stack.
|
||||
sName.assign(szStackBuffer, ulSize);
|
||||
return TRUE;
|
||||
} else {
|
||||
}
|
||||
if (::GetLastError() == ERROR_MORE_DATA) {
|
||||
// Allocate buffer on heap and retry.
|
||||
std::unique_ptr<char[]> szBuffer(new char[ulSize]);
|
||||
@ -40,8 +40,6 @@ static BOOLEAN GetUserNameExA(_In_ EXTENDED_NAME_FORMAT NameFormat, _Inout_ std:
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@ -63,7 +61,7 @@ static BOOLEAN GetUserNameExW(_In_ EXTENDED_NAME_FORMAT NameFormat, _Inout_ std:
|
||||
// Copy from stack.
|
||||
sName.assign(szStackBuffer, ulSize);
|
||||
return TRUE;
|
||||
} else {
|
||||
}
|
||||
if (::GetLastError() == ERROR_MORE_DATA) {
|
||||
// Allocate buffer on heap and retry.
|
||||
std::unique_ptr<wchar_t[]> szBuffer(new wchar_t[ulSize]);
|
||||
@ -72,8 +70,6 @@ static BOOLEAN GetUserNameExW(_In_ EXTENDED_NAME_FORMAT NameFormat, _Inout_ std:
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user