From: Carl Hetherington Date: Mon, 5 Jul 2021 13:22:07 +0000 (+0200) Subject: Use dcp::file_to_string(). X-Git-Tag: v2.15.156~12 X-Git-Url: https://main.carlh.net/gitweb/?p=dcpomatic.git;a=commitdiff_plain;h=da44da6f31f97d39ca91c35955e573e76371f2c2;hp=76e543bd7c85054ff857781707fa570f2b159360 Use dcp::file_to_string(). --- diff --git a/src/lib/send_problem_report_job.cc b/src/lib/send_problem_report_job.cc index e7fc02eb0..6ab83ee62 100644 --- 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 { - auto f = fopen_boost (_film->file(file), "r"); - if (!f) { - return; - } - 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"; - fclose (f); }