9 Aug
2023
9 Aug
'23
1:44 p.m.
Hans Leidekker (@hans) commented about programs/whoami/main.c:
- WideCharToMultiByte(GetOEMCP(), 0, str, len, strA, lenA, + WideCharToMultiByte(GetOEMCP(), 0, formatted, formatted_len, strA, lenA, NULL, NULL); WriteFile(GetStdHandle(STD_OUTPUT_HANDLE), strA, lenA, &count, FALSE); HeapFree(GetProcessHeap(), 0, strA); } + + HeapFree(GetProcessHeap(), 0, formatted); + return count; }
-int __cdecl wmain(int argc, WCHAR *argv[]) +static BOOL get_user_name(EXTENDED_NAME_FORMAT name_format, WCHAR **name) {
It's simpler to return the string in such functions, and NULL on error. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/3473#note_41795