diff --git a/src/system/Error.hxx b/src/system/Error.hxx index 5a10b6844..7f862a0ee 100644 --- a/src/system/Error.hxx +++ b/src/system/Error.hxx @@ -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)...); - char *p = buffer + length; - *p++ = ':'; - *p++ = ' '; - - CopyString(p, strerror(code), end - p); + snprintf(buffer, sizeof(buffer), + fmt, std::forward(args)...); return MakeErrno(code, buffer); }