Botan: Fix warning

GCC 4.7 warns about casting from (unsigned) byte to (signed) char

Change-Id: I00f3a5159e6471b8d43c122350fa223a3b14f5df
Reviewed-by: Christian Kandeler <christian.kandeler@nokia.com>
This commit is contained in:
Orgad Shaneh
2012-06-28 20:10:26 +03:00
committed by Christian Kandeler
parent e9f5d047bc
commit dbd3917bbe

View File

@@ -33386,20 +33386,18 @@ BigInt BigInt::decode(const byte buf[], size_t length, Base base)
else if(base == Hexadecimal) else if(base == Hexadecimal)
{ {
SecureVector<byte> binary; SecureVector<byte> binary;
const char *cbuf = reinterpret_cast<const char *>(buf);
if(length % 2) if(length % 2)
{ {
// Handle lack of leading 0 // Handle lack of leading 0
const char buf0_with_leading_0[2] = { '0', buf[0] }; const char buf0_with_leading_0[2] = { '0', cbuf[0] };
binary = hex_decode(buf0_with_leading_0, 2); binary = hex_decode(buf0_with_leading_0, 2);
binary += hex_decode(reinterpret_cast<const char*>(&buf[1]), binary += hex_decode(&cbuf[1], length - 1, false);
length - 1,
false);
} }
else else
binary = hex_decode(reinterpret_cast<const char*>(buf), binary = hex_decode(cbuf, length, false);
length, false);
r.binary_decode(&binary[0], binary.size()); r.binary_decode(&binary[0], binary.size());
} }