Fix warnings.

This commit is contained in:
Victor Zverovich
2014-05-06 08:13:28 -07:00
parent 5cf3b6dc7d
commit eb09e58697
2 changed files with 7 additions and 3 deletions

View File

@@ -148,7 +148,8 @@ std::string GetSystemErrorMessage(int error_code) {
enum { BUFFER_SIZE = 200 };
char buffer[BUFFER_SIZE];
EXPECT_EQ(0, strerror_s(buffer, BUFFER_SIZE, error_code));
EXPECT_LT(std::strlen(buffer), BUFFER_SIZE - 1);
std::size_t max_len = BUFFER_SIZE - 1;
EXPECT_LT(std::strlen(buffer), max_len);
return buffer;
#endif
}