diff --git a/format.cc b/format.cc index 6caa61f1..ab22f909 100644 --- a/format.cc +++ b/format.cc @@ -140,8 +140,9 @@ template <> struct IntChecker { template static bool fits_in_int(T value) { - return internal::check(value >= INT_MIN) && value <= INT_MAX; + return value >= INT_MIN && value <= INT_MAX; } + static bool fits_in_int(int value) { return true; } }; const char RESET_COLOR[] = "\x1b[0m"; diff --git a/test/gtest-extra-test.cc b/test/gtest-extra-test.cc index f51f3cce..93a1eca3 100644 --- a/test/gtest-extra-test.cc +++ b/test/gtest-extra-test.cc @@ -42,6 +42,13 @@ using testing::internal::scoped_ptr; namespace { +std::string sanitize(const std::string &s) { + std::string result; + for (std::string::const_iterator i = s.begin(), end = s.end(); i != end; ++i) + result.push_back(*i & 0xff); + return result; +} + // Tests that assertion macros evaluate their arguments exactly once. class SingleEvaluationTest : public ::testing::Test { protected: @@ -377,8 +384,7 @@ TEST(OutputRedirectTest, RestoreAndRead) { std::fprintf(file.get(), "[[["); OutputRedirect redir(file.get()); std::fprintf(file.get(), "censored"); - // coverity[tainted_data] - EXPECT_EQ("censored", redir.restore_and_read()); + EXPECT_EQ("censored", sanitize(redir.restore_and_read())); EXPECT_EQ("", redir.restore_and_read()); std::fprintf(file.get(), "]]]"); file = BufferedFile();