X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Ftools%2Fdcpomatic_kdm.cc;h=6257d60af3f636e2a25eaf3464eebafa993c5ee3;hb=c6c082c4a8016f85ba4207f4b8ccee1d5770e4a4;hp=2ad07cce7a38bae73c62f2b1824def725e9ada34;hpb=73f52e94953848c696725defd3d7f5c4c30707e2;p=dcpomatic.git diff --git a/src/tools/dcpomatic_kdm.cc b/src/tools/dcpomatic_kdm.cc index 2ad07cce7..6257d60af 100644 --- a/src/tools/dcpomatic_kdm.cc +++ b/src/tools/dcpomatic_kdm.cc @@ -24,9 +24,9 @@ #include "lib/kdm.h" #include "lib/config.h" #include "lib/exceptions.h" +#include "lib/safe_stringstream.h" using std::string; -using std::stringstream; using std::cout; using std::cerr; using std::list; @@ -76,7 +76,7 @@ time_from_string (string t) static boost::posix_time::time_duration duration_from_string (string d) { - stringstream s (d); + SafeStringStream s (d); int N; string unit; s >> N >> unit; @@ -177,7 +177,7 @@ int main (int argc, char* argv[]) } else if (string (optarg) == "dci-specific") { formulation = dcp::DCI_SPECIFIC; } else { - error ("unrecognised KDM formulation " + formulation); + error ("unrecognised KDM formulation " + string (optarg)); } } } @@ -248,7 +248,7 @@ int main (int argc, char* argv[]) error ("you must specify --output"); } - shared_ptr certificate (new dcp::Certificate (boost::filesystem::path (certificate_file))); + dcp::Certificate certificate (dcp::file_to_string (certificate_file)); dcp::EncryptedKDM kdm = film->make_kdm (certificate, cpl, valid_from.get(), valid_to.get(), formulation); kdm.as_xml (output); if (verbose) {