mirror of
https://github.com/fmtlib/fmt.git
synced 2024-11-11 05:30:05 +00:00
Suppress bogus coverity warnings
This commit is contained in:
parent
869ed1ec19
commit
b64913b00b
@ -449,6 +449,7 @@ class BasicArgFormatter : public ArgVisitor<Impl, void> {
|
||||
std::fill_n(out, spec_.width_ - 1, fill);
|
||||
out += spec_.width_ - 1;
|
||||
} else if (spec_.align_ == ALIGN_CENTER) {
|
||||
// coverity[suspicious_sizeof]
|
||||
out = writer_.fill_padding(out, spec_.width_, 1, fill);
|
||||
} else {
|
||||
std::fill_n(out + 1, spec_.width_ - 1, fill);
|
||||
|
@ -40,9 +40,6 @@
|
||||
|
||||
using testing::internal::scoped_ptr;
|
||||
|
||||
// Marks the argument as sanitized (defined in Coverity model file).
|
||||
const std::string &sanitize(const std::string &s) { return s; }
|
||||
|
||||
namespace {
|
||||
|
||||
// Tests that assertion macros evaluate their arguments exactly once.
|
||||
@ -380,7 +377,8 @@ TEST(OutputRedirectTest, RestoreAndRead) {
|
||||
std::fprintf(file.get(), "[[[");
|
||||
OutputRedirect redir(file.get());
|
||||
std::fprintf(file.get(), "censored");
|
||||
EXPECT_EQ("censored", sanitize(redir.restore_and_read()));
|
||||
// coverity[tainted_data]
|
||||
EXPECT_EQ("censored", redir.restore_and_read());
|
||||
EXPECT_EQ("", redir.restore_and_read());
|
||||
std::fprintf(file.get(), "]]]");
|
||||
file = BufferedFile();
|
||||
|
Loading…
Reference in New Issue
Block a user