Changeset - r25686:fb6d0e17cffc
[Not reviewed]
master
0 2 0
rubidium42 - 3 years ago 2021-06-13 19:41:07
rubidium@openttd.org
Codechange: [Network] Let NetworkError return its std::string instead of a C-string
2 files changed with 3 insertions and 3 deletions:
0 comments (0 inline, 0 general)
src/network/core/os_abstraction.cpp
Show inline comments
 
@@ -76,7 +76,7 @@ bool NetworkError::IsConnectInProgress()
 
 * Get the string representation of the error message.
 
 * @return The string representation that will get overwritten by next calls.
 
 */
 
const char *NetworkError::AsString() const
 
const std::string &NetworkError::AsString() const
 
{
 
	if (this->message.empty()) {
 
#if defined(_WIN32)
 
@@ -97,7 +97,7 @@ const char *NetworkError::AsString() con
 
		this->message.assign(strerror(this->error));
 
#endif
 
	}
 
	return this->message.c_str();
 
	return this->message;
 
}
 

	
 
/**
src/network/core/os_abstraction.h
Show inline comments
 
@@ -29,7 +29,7 @@ public:
 
	bool WouldBlock() const;
 
	bool IsConnectionReset() const;
 
	bool IsConnectInProgress() const;
 
	const char *AsString() const;
 
	const std::string &AsString() const;
 

	
 
	static NetworkError GetLast();
 
};
0 comments (0 inline, 0 general)