system/Error: fix duplicate strerror() call
Apparently, the std::system_error constructor appends strerror() already.
This commit is contained in:
parent
e939d667d9
commit
672e18cac9
@ -111,14 +111,8 @@ static inline std::system_error
|
|||||||
FormatErrno(int code, const char *fmt, Args&&... args)
|
FormatErrno(int code, const char *fmt, Args&&... args)
|
||||||
{
|
{
|
||||||
char buffer[512];
|
char buffer[512];
|
||||||
const auto end = buffer + sizeof(buffer);
|
snprintf(buffer, sizeof(buffer),
|
||||||
size_t length = snprintf(buffer, sizeof(buffer) - 128,
|
fmt, std::forward<Args>(args)...);
|
||||||
fmt, std::forward<Args>(args)...);
|
|
||||||
char *p = buffer + length;
|
|
||||||
*p++ = ':';
|
|
||||||
*p++ = ' ';
|
|
||||||
|
|
||||||
CopyString(p, strerror(code), end - p);
|
|
||||||
return MakeErrno(code, buffer);
|
return MakeErrno(code, buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user