From 17612efe9039ba2074299b5423cb7b927efd24a2 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Thu, 10 Sep 2020 22:16:43 +0200 Subject: Use Data::write() to clean things up slightly. --- src/interop_subtitle_asset.cc | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'src') 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); } } -- cgit v1.2.3