mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-13 21:36:00 +03:00
Code cosmetics: Clean up MD5 hexdigest
The null terminator is not necessary when using this form of the std::string constructor, and its use was confusing given the extra indent.
This commit is contained in:
parent
d0b423fdd7
commit
cd1a058c33
@ -13,10 +13,10 @@ std::string Md5::hexdigest(std::string& input) {
|
||||
mbedtls_md5(reinterpret_cast<const unsigned char *>(input.c_str()),
|
||||
input.size(), digest);
|
||||
|
||||
char buf[33];
|
||||
for (int i=0; i<16; i++)
|
||||
char buf[32];
|
||||
for (int i = 0; i < 16; i++) {
|
||||
sprintf(buf+i*2, "%02x", digest[i]);
|
||||
buf[32]=0;
|
||||
}
|
||||
|
||||
return std::string(buf, 32);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user