Commit 672e18ca authored by Max Kellermann's avatar Max Kellermann

system/Error: fix duplicate strerror() call

Apparently, the std::system_error constructor appends strerror() already.
parent e939d667
......@@ -111,14 +111,8 @@ static inline std::system_error
FormatErrno(int code, const char *fmt, Args&&... args)
{
char buffer[512];
const auto end = buffer + sizeof(buffer);
size_t length = snprintf(buffer, sizeof(buffer) - 128,
fmt, std::forward<Args>(args)...);
char *p = buffer + length;
*p++ = ':';
*p++ = ' ';
CopyString(p, strerror(code), end - p);
snprintf(buffer, sizeof(buffer),
fmt, std::forward<Args>(args)...);
return MakeErrno(code, buffer);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment