Skip to content

Commit 7f3f0d1

Browse files
Place after open
1 parent bb3b70a commit 7f3f0d1

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

include/rfl/io/save_string.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ Result<Nothing> save_string(const std::string& _fname, const T& _obj,
1414
const WriteFunction& _write) {
1515
try {
1616
std::ofstream outfile;
17+
outfile.open(_fname);
1718
if (!outfile.is_open()) {
1819
return error("Unable to open file '" + _fname + "' for writing.");
1920
}
20-
outfile.open(_fname);
2121
_write(_obj, outfile);
2222
outfile.close();
2323
} catch (std::exception& e) {

0 commit comments

Comments
 (0)