projects
/
libdcp.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
bd49131
)
Fix fopen call and throw an exception if it fails.
author
Carl Hetherington
<cth@carlh.net>
Fri, 4 Jul 2014 14:39:35 +0000
(15:39 +0100)
committer
Carl Hetherington
<cth@carlh.net>
Fri, 4 Jul 2014 14:39:35 +0000
(15:39 +0100)
src/subtitle_content.cc
patch
|
blob
|
history
diff --git
a/src/subtitle_content.cc
b/src/subtitle_content.cc
index 7e11dea4b20545f8d6d2412551072d6fefe7d3b3..5a45d7372164845889540e6072f716aebfba2672 100644
(file)
--- a/
src/subtitle_content.cc
+++ b/
src/subtitle_content.cc
@@
-238,7
+238,11
@@
struct SubtitleSorter {
void
SubtitleContent::write_xml (boost::filesystem::path p) const
{
- FILE* f = fopen_boost (p, "r");
+ FILE* f = fopen_boost (p, "w");
+ if (!f) {
+ throw FileError ("Could not open file for writing", p, -1);
+ }
+
Glib::ustring const s = xml_as_string ();
fwrite (s.c_str(), 1, s.length(), f);
fclose (f);