ssh: Remove unnecessary use of strlen function.

Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Stefan Weil <sw@weilnetz.de>

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
This commit is contained in:
Richard W.M. Jones 2013-04-18 22:09:33 +01:00 committed by Stefan Hajnoczi
parent 6ae7d660a0
commit c7a101f529

View File

@ -387,15 +387,13 @@ static int check_host_key(BDRVSSHState *s, const char *host, int port,
}
/* host_key_check=md5:xx:yy:zz:... */
if (strlen(host_key_check) >= 4 &&
strncmp(host_key_check, "md5:", 4) == 0) {
if (strncmp(host_key_check, "md5:", 4) == 0) {
return check_host_key_hash(s, &host_key_check[4],
LIBSSH2_HOSTKEY_HASH_MD5, 16);
}
/* host_key_check=sha1:xx:yy:zz:... */
if (strlen(host_key_check) >= 5 &&
strncmp(host_key_check, "sha1:", 5) == 0) {
if (strncmp(host_key_check, "sha1:", 5) == 0) {
return check_host_key_hash(s, &host_key_check[5],
LIBSSH2_HOSTKEY_HASH_SHA1, 20);
}