Merge branch 'master' into jgrpp
# Conflicts: # src/cheat_gui.cpp # src/command.cpp # src/command_func.h # src/company_base.h # src/debug.cpp # src/debug.h # src/economy.cpp # src/engine_type.h # src/graph_gui.cpp # src/misc_cmd.cpp # src/misc_cmd.h # src/network/core/os_abstraction.cpp # src/openttd.cpp # src/saveload/saveload.cpp # src/saveload/saveload.h # src/settings_type.h # src/ship_cmd.cpp # src/stdafx.h # src/tests/bitmath_func.cpp # src/town_cmd.cpp # src/town_gui.cpp
This commit is contained in:
		| @@ -73,15 +73,16 @@ NetworkHTTPRequest::NetworkHTTPRequest(const std::wstring &uri, HTTPCallback *ca | ||||
|  | ||||
| static std::string GetLastErrorAsString() | ||||
| { | ||||
| 	char buffer[512]; | ||||
| 	wchar_t buffer[512]; | ||||
|  | ||||
| 	DWORD error_code = GetLastError(); | ||||
|  | ||||
| 	if (FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_FROM_HMODULE | FORMAT_MESSAGE_IGNORE_INSERTS, GetModuleHandleA("winhttp.dll"), error_code, | ||||
| 		MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), buffer, sizeof(buffer), nullptr) == 0) { | ||||
| 	if (FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_FROM_HMODULE | FORMAT_MESSAGE_IGNORE_INSERTS, GetModuleHandle(L"winhttp.dll"), error_code, | ||||
| 		MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), buffer, lengthof(buffer), nullptr) == 0) { | ||||
| 		return fmt::format("unknown error {}", error_code); | ||||
| 	} | ||||
|  | ||||
| 	return buffer; | ||||
| 	return FS2OTTD(buffer); | ||||
| } | ||||
|  | ||||
| /** | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Jonathan G Rennison
					Jonathan G Rennison