From b1dc9c3a2f7e55c9afc5bf2d5b465371b048e14f Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Wed, 10 Aug 2016 16:38:33 +0100 Subject: Remove all use of stringstream in an attempt to fix the suspected thread-unsafe crash bugs on OS X. --- src/lib/content.cc | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'src/lib/content.cc') diff --git a/src/lib/content.cc b/src/lib/content.cc index a56573ed2..9c7e79040 100644 --- a/src/lib/content.cc +++ b/src/lib/content.cc @@ -30,7 +30,6 @@ #include "job.h" #include "compose.hpp" #include "raw_convert.h" -#include #include #include #include @@ -254,14 +253,12 @@ Content::length_after_trim () const string Content::identifier () const { - locked_stringstream s; - - s << Content::digest() - << "_" << position().get() - << "_" << trim_start().get() - << "_" << trim_end().get(); - - return s.str (); + char buffer[256]; + snprintf ( + buffer, sizeof(buffer), "%s_%" PRId64 "_%" PRId64 "_%" PRId64, + Content::digest().c_str(), position().get(), trim_start().get(), trim_end().get() + ); + return buffer; } bool -- cgit v1.2.3