Skip to content

Commit

Permalink
Simplify stdout_print using fwrite
Browse files Browse the repository at this point in the history
  • Loading branch information
cschreib committed Apr 12, 2023
1 parent 581c1b4 commit 0954970
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/snitch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#include <algorithm> // for std::sort
#include <cinttypes> // for format strings
#include <cstdio> // for std::printf, std::snprintf
#include <cstdio> // for std::fwrite, std::snprintf
#include <cstring> // for std::memcpy
#include <optional> // for std::optional

Expand Down Expand Up @@ -279,8 +279,7 @@ bool is_match(std::string_view string, std::string_view regex) noexcept {

namespace snitch::impl {
void stdout_print(std::string_view message) noexcept {
// TODO: replace this with std::print?
std::printf("%.*s", static_cast<int>(message.length()), message.data());
std::fwrite(message.data(), sizeof(char), message.length(), stdout);
}

test_state& get_current_test() noexcept {
Expand Down

0 comments on commit 0954970

Please sign in to comment.