Fix windows build.

This commit is contained in:
Victor Zverovich 2014-09-05 10:56:00 -07:00
parent f2c9df8e9f
commit 445663fade

View File

@ -44,9 +44,8 @@ std::string get_system_error(int error_code) {
#else #else
enum { BUFFER_SIZE = 200 }; enum { BUFFER_SIZE = 200 };
char buffer[BUFFER_SIZE]; char buffer[BUFFER_SIZE];
EXPECT_EQ(0, strerror_s(buffer, BUFFER_SIZE, error_code)); if (strerror_s(buffer, BUFFER_SIZE, error_code))
std::size_t max_len = BUFFER_SIZE - 1; throw std::exception("strerror_s failed");
EXPECT_LT(std::strlen(buffer), max_len);
return buffer; return buffer;
#endif #endif
} }