Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/gabime/spdlog.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgabime <gmelman1@gmail.com>2018-06-10 23:22:19 +0300
committergabime <gmelman1@gmail.com>2018-06-10 23:22:19 +0300
commit66b5772b61a5959e80c795a2ea90ff9bdded985e (patch)
tree7eae32681da2665019154284636a48a7228f27ac
parentfaea32c9f9b7c4d2e73c90780e4e0f81cf996d2a (diff)
Fixed issue #720
-rw-r--r--include/spdlog/common.h15
1 files changed, 3 insertions, 12 deletions
diff --git a/include/spdlog/common.h b/include/spdlog/common.h
index 1d8d954c..e02cb0bf 100644
--- a/include/spdlog/common.h
+++ b/include/spdlog/common.h
@@ -153,18 +153,9 @@ public:
spdlog_ex(const std::string &msg, int last_errno)
{
- std::string errno_string;
- char buf[256], *buf_ptr = buf;
-
- if (fmt::safe_strerror(last_errno, buf_ptr, sizeof(buf)) == 0)
- {
- errno_string = buf_ptr;
- }
- else
- {
- errno_string = "Unknown error";
- }
- _msg = msg + ": " + errno_string;
+ fmt::MemoryWriter writer;
+ fmt::format_system_error(writer, last_errno, msg);
+ _msg = writer.str();
}
const char *what() const SPDLOG_NOEXCEPT override