summaryrefslogtreecommitdiff
path: root/src/lib/config.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2018-12-23 21:38:44 +0000
committerCarl Hetherington <cth@carlh.net>2018-12-23 21:38:44 +0000
commit196de029044f4dbac5f74f68e08a89f778c3a236 (patch)
tree92ae37c7b95d8c2839834ab181ad4b0da1f35da8 /src/lib/config.cc
parente7a9a9a0b69d605e327d5a74abe28481d2a61179 (diff)
Be a bit more careful with fwrite.
Diffstat (limited to 'src/lib/config.cc')
-rw-r--r--src/lib/config.cc6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/lib/config.cc b/src/lib/config.cc
index 172890dcf..eb2671365 100644
--- a/src/lib/config.cc
+++ b/src/lib/config.cc
@@ -987,11 +987,7 @@ Config::write_config () const
if (!f) {
throw FileError (_("Could not open file for writing"), cf);
}
- size_t const w = fwrite (s.c_str(), 1, s.length(), f);
- if (w != s.length()) {
- fclose (f);
- throw FileError (_("Could not write whole file"), cf);
- }
+ checked_fwrite (s.c_str(), s.length(), f, cf);
fclose (f);
} catch (xmlpp::exception& e) {
string s = e.what ();