From 539b6c58f5d9fa9487f8d831f11320517e4dae47 Mon Sep 17 00:00:00 2001 From: Rolf Eike Beer Date: Fri, 4 Apr 2014 23:25:33 +0200 Subject: [PATCH] Fix build on AIX failing because of access to string elements The compilation failed with this error message: .../Source/cmCryptoHash.cxx: In method `string cmCryptoHash::HashString (const string &)': .../Source/cmCryptoHash.cxx:41: non-lvalue in unary `&' This was introduced in 77f60392d93f41a8828d3db1d7b76d45f1535d07 (stringapi: Accept strings when MD5 hashing data). --- Source/cmCryptoHash.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/cmCryptoHash.cxx b/Source/cmCryptoHash.cxx index 0d3c6bbcb..74e17b622 100644 --- a/Source/cmCryptoHash.cxx +++ b/Source/cmCryptoHash.cxx @@ -38,7 +38,7 @@ cmsys::auto_ptr cmCryptoHash::New(const char* algo) std::string cmCryptoHash::HashString(const std::string& input) { this->Initialize(); - this->Append(reinterpret_cast(&input[0]), + this->Append(reinterpret_cast(input.c_str()), static_cast(input.size())); return this->Finalize(); }