From a6a1294944d4ce02cbb429ca1aec07ca78d79a88 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Thu, 27 May 2021 14:21:35 +0200 Subject: Tidy handling of _raw_xml. Before this if we tried to get the XML of an encrypted asset we would just get an empty string. Now we get a boost::none which means the verifier can avoid trying to check details of the XML (and instead raise a warning that you are trying to verify data that it cannot decrypt). --- src/interop_subtitle_asset.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/interop_subtitle_asset.cc') diff --git a/src/interop_subtitle_asset.cc b/src/interop_subtitle_asset.cc index 453cad8b..a7be5d1a 100644 --- a/src/interop_subtitle_asset.cc +++ b/src/interop_subtitle_asset.cc @@ -199,9 +199,9 @@ InteropSubtitleAsset::write (boost::filesystem::path p) const throw FileError ("Could not open file for writing", p, -1); } - auto const s = xml_as_string (); + _raw_xml = xml_as_string (); /* length() here gives bytes not characters */ - fwrite (s.c_str(), 1, s.length(), f); + fwrite (_raw_xml->c_str(), 1, _raw_xml->length(), f); fclose (f); _file = p; -- cgit v1.2.3