diff options
| author | Carl Hetherington <cth@carlh.net> | 2020-09-10 22:16:43 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2020-09-11 01:03:42 +0200 |
| commit | 17612efe9039ba2074299b5423cb7b927efd24a2 (patch) | |
| tree | e04d4f931fafcf6f102a14eb685151b8eee94e74 /src | |
| parent | 015e9c2d11f5ada16351eea57959e93dca7b45ea (diff) | |
Use Data::write() to clean things up slightly.
Diffstat (limited to 'src')
| -rw-r--r-- | src/interop_subtitle_asset.cc | 7 |
1 files changed, 1 insertions, 6 deletions
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<InteropLoadFontNode> 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<Font>::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); } } |
