summaryrefslogtreecommitdiffstats
path: root/tools/bootstrp/md5.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'tools/bootstrp/md5.cxx')
-rw-r--r--tools/bootstrp/md5.cxx13
1 files changed, 8 insertions, 5 deletions
diff --git a/tools/bootstrp/md5.cxx b/tools/bootstrp/md5.cxx
index 1df85d32ff80..18ecb46ceb9d 100644
--- a/tools/bootstrp/md5.cxx
+++ b/tools/bootstrp/md5.cxx
@@ -34,7 +34,7 @@
#include <cstddef>
#include <stdio.h>
-#include <tools/string.hxx>
+#include <rtl/strbuf.hxx>
#ifdef WNT
#define FILE_OPEN_READ "rb"
@@ -93,13 +93,14 @@ void normalize_pe_image(sal_uInt8* buffer, size_t nBufferSize)
}
}
-rtlDigestError calc_md5_checksum( const char *filename, ByteString &aChecksum )
+rtlDigestError calc_md5_checksum(const char *filename, rtl::OString &rChecksum)
{
const size_t BUFFER_SIZE = 0x1000;
const size_t MINIMAL_SIZE = 512;
sal_uInt8 checksum[RTL_DIGEST_LENGTH_MD5];
- rtlDigestError error = rtl_Digest_E_None;
+ rtlDigestError error = rtl_Digest_E_None;
+ rtl::OStringBuffer aChecksumBuf;
FILE *fp = fopen( filename, FILE_OPEN_READ );
@@ -136,8 +137,8 @@ rtlDigestError calc_md5_checksum( const char *filename, ByteString &aChecksum )
for ( std::size_t i = 0; i < sizeof(checksum); i++ )
{
if ( checksum[i] < 16 )
- aChecksum.Append( "0" );
- aChecksum += ByteString::CreateFromInt32( checksum[i], 16 );
+ aChecksumBuf.append('0');
+ aChecksumBuf.append(static_cast<sal_Int32>(checksum[i]), 16);
}
}
@@ -146,6 +147,8 @@ rtlDigestError calc_md5_checksum( const char *filename, ByteString &aChecksum )
else
error = rtl_Digest_E_Unknown;
+ rChecksum = aChecksumBuf.makeStringAndClear();
+
return error;
}