summaryrefslogtreecommitdiff
path: root/lib/ssh.c
diff options
context:
space:
mode:
authorMarcel Raad <Marcel.Raad@teamviewer.com>2019-05-11 21:42:48 +0200
committerMarcel Raad <Marcel.Raad@teamviewer.com>2019-05-20 08:51:11 +0200
commit10db3ef21eef1c7a1727579952a81ced2f4afc8b (patch)
tree57129a847b5913959063a60290201b1f52482fee /lib/ssh.c
parent27af2ec219244bef24e6d11649d41aad3668da45 (diff)
downloadcurl-10db3ef21eef1c7a1727579952a81ced2f4afc8b.tar.gz
lib: reduce variable scopes
Fixes Codacy/CppCheck warnings. Closes https://github.com/curl/curl/pull/3872
Diffstat (limited to 'lib/ssh.c')
-rw-r--r--lib/ssh.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/ssh.c b/lib/ssh.c
index e8b8ed61a..a265c3c9a 100644
--- a/lib/ssh.c
+++ b/lib/ssh.c
@@ -587,13 +587,13 @@ static CURLcode ssh_check_fingerprint(struct connectdata *conn)
struct Curl_easy *data = conn->data;
const char *pubkey_md5 = data->set.str[STRING_SSH_HOST_PUBLIC_KEY_MD5];
char md5buffer[33];
- int i;
const char *fingerprint = libssh2_hostkey_hash(sshc->ssh_session,
LIBSSH2_HOSTKEY_HASH_MD5);
if(fingerprint) {
/* The fingerprint points to static storage (!), don't free() it. */
+ int i;
for(i = 0; i < 16; i++)
msnprintf(&md5buffer[i*2], 3, "%02x", (unsigned char) fingerprint[i]);
infof(data, "SSH MD5 fingerprint: %s\n", md5buffer);