Skip to content

Commit

Permalink
fix output on windows #204
Browse files Browse the repository at this point in the history
  • Loading branch information
rulerofthehuns committed Mar 31, 2021
1 parent f6f7253 commit 04efb6f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion backward.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3834,7 +3834,7 @@ class cfile_streambuf : public std::streambuf {
cfile_streambuf(FILE *_sink) : sink(_sink) {}
int_type underflow() override { return traits_type::eof(); }
int_type overflow(int_type ch) override {
if (traits_type::not_eof(ch) && fwrite(&ch, sizeof ch, 1, sink) == 1) {
if (traits_type::not_eof(ch) && fputc(ch, sink) != EOF) {
return ch;
}
return traits_type::eof();
Expand Down

0 comments on commit 04efb6f

Please sign in to comment.