Skip to content

Commit

Permalink
Cheats: Fix error while exporting
Browse files Browse the repository at this point in the history
  • Loading branch information
stenzek committed Jan 4, 2025
1 parent 548f1da commit 78ccbc7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/cheats.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1520,7 +1520,7 @@ bool Cheats::ExportCodesToFile(std::string path, const CodeInfoList& codes, Erro
for (const CodeInfo& code : codes)
{
const std::string code_body = FormatCodeForFile(code);
if (std::fwrite(code_body.data(), code_body.length(), 1, fp.get()) != 1 || std::fputc('\n', fp.get()) != 0)
if (std::fwrite(code_body.data(), code_body.length(), 1, fp.get()) != 1 || std::fputc('\n', fp.get()) == EOF)
{
Error::SetErrno(error, "fwrite() failed: ", errno);
FileSystem::DiscardAtomicRenamedFile(fp);
Expand Down

0 comments on commit 78ccbc7

Please sign in to comment.