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/digester.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/lib/digester.cc') diff --git a/src/lib/digester.cc b/src/lib/digester.cc index 70c2babf5..155d43af4 100644 --- a/src/lib/digester.cc +++ b/src/lib/digester.cc @@ -19,7 +19,6 @@ */ #include "digester.h" -#include #include #include @@ -57,12 +56,12 @@ Digester::get () const unsigned char digest[MD5_DIGEST_SIZE]; md5_digest (&_context, MD5_DIGEST_SIZE, digest); - locked_stringstream s; + char hex[MD5_DIGEST_SIZE * 2 + 1]; for (int i = 0; i < MD5_DIGEST_SIZE; ++i) { - s << hex << setfill('0') << setw(2) << ((int) digest[i]); + sprintf(hex + i * 2, "%02x", digest[i]); } - _digest = s.str (); + _digest = hex; } return _digest.get (); -- cgit v1.2.3