summaryrefslogtreecommitdiff
path: root/src/lib/digester.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2016-08-10 16:38:33 +0100
committerCarl Hetherington <cth@carlh.net>2016-08-12 09:13:51 +0100
commitb1dc9c3a2f7e55c9afc5bf2d5b465371b048e14f (patch)
tree9968238c6c0511f044e6fcdb4abcc08b5eb28f27 /src/lib/digester.cc
parent4a0ae92e28d7d1f0dd648d1b620efc324fdef161 (diff)
Remove all use of stringstream in an attempt to fix
the suspected thread-unsafe crash bugs on OS X.
Diffstat (limited to 'src/lib/digester.cc')
-rw-r--r--src/lib/digester.cc7
1 files changed, 3 insertions, 4 deletions
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 <locked_sstream.h>
#include <nettle/md5.h>
#include <iomanip>
@@ -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 ();