projects
/
dcpomatic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
76e543b
)
Use dcp::file_to_string().
author
Carl Hetherington
<cth@carlh.net>
Mon, 5 Jul 2021 13:22:07 +0000
(15:22 +0200)
committer
Carl Hetherington
<cth@carlh.net>
Mon, 5 Jul 2021 13:22:56 +0000
(15:22 +0200)
src/lib/send_problem_report_job.cc
patch
|
blob
|
history
diff --git
a/src/lib/send_problem_report_job.cc
b/src/lib/send_problem_report_job.cc
index e7fc02eb0e0b13437eb45007f417c09cc6710f8a..6ab83ee6211d6bea24b93fb6e6367f367d93f979 100644
(file)
--- a/
src/lib/send_problem_report_job.cc
+++ b/
src/lib/send_problem_report_job.cc
@@
-119,19
+119,8
@@
SendProblemReportJob::run ()
void
SendProblemReportJob::add_file (string& body, boost::filesystem::path file) const
{
void
SendProblemReportJob::add_file (string& body, boost::filesystem::path file) const
{
- auto f = fopen_boost (_film->file(file), "r");
- if (!f) {
- return;
- }
-
body += file.string() + ":\n";
body += "---<8----\n";
body += file.string() + ":\n";
body += "---<8----\n";
- auto const size = boost::filesystem::file_size (_film->file(file));
- char* buffer = new char[size + 1];
- int const N = fread (buffer, 1, size, f);
- buffer[N] = '\0';
- body += buffer;
- delete[] buffer;
+ body += dcp::file_to_string (_film->file(file));
body += "---<8----\n\n";
body += "---<8----\n\n";
- fclose (f);
}
}