Skip to content

Commit

Permalink
Replace fputc with ungetc to fix UB
Browse files Browse the repository at this point in the history
Closes #185.
  • Loading branch information
dpogue committed Oct 1, 2024
1 parent 3059123 commit 1309c84
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion streams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ uint32_t DS::FileStream::size() const
bool DS::FileStream::atEof()
{
int ch = fgetc(m_file);
fputc(ch, m_file);
ungetc(ch, m_file);
return (ch == EOF);
}

Expand Down

0 comments on commit 1309c84

Please sign in to comment.