From: Carl Hetherington Date: Thu, 10 Sep 2020 20:16:43 +0000 (+0200) Subject: Use Data::write() to clean things up slightly. X-Git-Tag: v1.8.0~313 X-Git-Url: https://main.carlh.net/gitweb/?a=commitdiff_plain;h=17612efe9039ba2074299b5423cb7b927efd24a2;p=libdcp.git Use Data::write() to clean things up slightly. --- diff --git a/src/interop_subtitle_asset.cc b/src/interop_subtitle_asset.cc index 39521ed7..6c9c6b42 100644 --- a/src/interop_subtitle_asset.cc +++ b/src/interop_subtitle_asset.cc @@ -198,19 +198,14 @@ InteropSubtitleAsset::write (boost::filesystem::path p) const /* Fonts */ BOOST_FOREACH (shared_ptr i, _load_font_nodes) { boost::filesystem::path file = p.parent_path() / i->uri; - FILE* f = fopen_boost (file, "wb"); - if (!f) { - throw FileError ("could not open font file for writing", file, errno); - } list::const_iterator j = _fonts.begin (); while (j != _fonts.end() && j->load_id != i->id) { ++j; } if (j != _fonts.end ()) { - fwrite (j->data.data().get(), 1, j->data.size(), f); + j->data.write (file); j->file = file; } - fclose (f); } }