From 18c3b488dff343a9b287d8d0fd68143b792ec75e Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Fri, 27 Nov 2015 18:42:07 +0000 Subject: [PATCH] Fix some stringstreams that had crept in. --- src/lib/emailer.cc | 3 +-- src/lib/json_server.cc | 5 ++--- src/lib/video_content.cc | 3 +-- test/video_content_scale_test.cc | 3 +-- 4 files changed, 5 insertions(+), 9 deletions(-) diff --git a/src/lib/emailer.cc b/src/lib/emailer.cc index 50ced3340..b605d067d 100644 --- a/src/lib/emailer.cc +++ b/src/lib/emailer.cc @@ -30,7 +30,6 @@ #include "i18n.h" using std::string; -using std::stringstream; using std::min; using std::list; using std::cout; @@ -102,7 +101,7 @@ Emailer::send () boost::posix_time::time_duration offset = local_now - utc_now; sprintf (date_buffer + strlen(date_buffer), "%s%02d%02d", (offset.hours() >= 0 ? "+" : "-"), abs (offset.hours()), offset.minutes()); - stringstream email; + SafeStringStream email; email << "Date: " << date_buffer << "\r\n" << "To: " << address_list (_to) << "\r\n" diff --git a/src/lib/json_server.cc b/src/lib/json_server.cc index c7a3ca144..38d5501c5 100644 --- a/src/lib/json_server.cc +++ b/src/lib/json_server.cc @@ -29,7 +29,6 @@ #include using std::string; -using std::stringstream; using std::cout; using std::map; using std::list; @@ -151,7 +150,7 @@ JSONServer::request (string url, shared_ptr socket) action = r["action"]; } - stringstream json; + SafeStringStream json; if (action == "status") { list > jobs = JobManager::instance()->get (); @@ -187,7 +186,7 @@ JSONServer::request (string url, shared_ptr socket) } } - stringstream reply; + SafeStringStream reply; reply << "HTTP/1.1 200 OK\r\n" << "Content-Length: " << json.str().length() << "\r\n" << "Content-Type: application/json\r\n" diff --git a/src/lib/video_content.cc b/src/lib/video_content.cc index 78b320034..7321fc7c5 100644 --- a/src/lib/video_content.cc +++ b/src/lib/video_content.cc @@ -55,7 +55,6 @@ using std::cout; using std::vector; using std::min; using std::max; -using std::stringstream; using std::fixed; using std::setprecision; using std::list; @@ -512,7 +511,7 @@ string VideoContent::processing_description () const { /* stringstream is OK here as this string is just for presentation to the user */ - stringstream d; + SafeStringStream d; if (video_size().width && video_size().height) { d << String::compose ( diff --git a/test/video_content_scale_test.cc b/test/video_content_scale_test.cc index 8c3bd431a..1acac8a37 100644 --- a/test/video_content_scale_test.cc +++ b/test/video_content_scale_test.cc @@ -24,7 +24,6 @@ using std::list; using std::string; using std::cerr; -using std::stringstream; using boost::shared_ptr; using boost::optional; @@ -33,7 +32,7 @@ void test (dcp::Size content_size, dcp::Size display_size, dcp::Size film_size, Crop crop, Ratio const * ratio, bool scale, dcp::Size correct) { shared_ptr film; - stringstream s; + SafeStringStream s; s << "" "" "FFmpeg" -- 2.30.2