fix
(this is one reason the string class having an implicit cast to char* is bad; lots of things compile but don't work, causing bugs like this)
This commit is contained in:
@@ -337,7 +337,7 @@ void RSAKey::Fingerprint( char *str, int len ) const
|
|||||||
strncpy(str, buffer, len);
|
strncpy(str, buffer, len);
|
||||||
str[len - 1] = '\0';
|
str[len - 1] = '\0';
|
||||||
slen = strlen(str);
|
slen = strlen(str);
|
||||||
if (this->comment && slen < len - 1)
|
if (!this->comment.empty() && slen < len - 1)
|
||||||
{
|
{
|
||||||
str[slen] = ' ';
|
str[slen] = ' ';
|
||||||
strncpy(str + slen + 1, this->comment, len - slen - 1);
|
strncpy(str + slen + 1, this->comment, len - slen - 1);
|
||||||
|
|||||||
Reference in New Issue
Block a user