mirror of
https://github.com/fmtlib/fmt.git
synced 2024-11-02 02:29:08 +00:00
Fix windows build.
This commit is contained in:
parent
f2c9df8e9f
commit
445663fade
@ -44,9 +44,8 @@ std::string get_system_error(int error_code) {
|
||||
#else
|
||||
enum { BUFFER_SIZE = 200 };
|
||||
char buffer[BUFFER_SIZE];
|
||||
EXPECT_EQ(0, strerror_s(buffer, BUFFER_SIZE, error_code));
|
||||
std::size_t max_len = BUFFER_SIZE - 1;
|
||||
EXPECT_LT(std::strlen(buffer), max_len);
|
||||
if (strerror_s(buffer, BUFFER_SIZE, error_code))
|
||||
throw std::exception("strerror_s failed");
|
||||
return buffer;
|
||||
#endif
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user