From 0e122f13faef7c9d5989c92afd5367e93bab0769 Mon Sep 17 00:00:00 2001 From: iota97 Date: Wed, 6 Jan 2021 10:26:44 +0100 Subject: [PATCH] Fix adding extra new line on checkbox change --- UI/CwCheatScreen.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/UI/CwCheatScreen.cpp b/UI/CwCheatScreen.cpp index a13ef059d8..2e1d706b48 100644 --- a/UI/CwCheatScreen.cpp +++ b/UI/CwCheatScreen.cpp @@ -328,8 +328,10 @@ bool CwCheatScreen::RebuildCheatFile(int index) { return false; } - for (const auto &line : lines) { - fs << line << '\n'; + for (int i = 0; i < lines.size(); ++i) { + fs << lines[i]; + if (i != lines.size()-1) + fs << '\n'; } fs.close();