From 8b96552f0df2703c9ef90a57faa43e7e7ae011bb Mon Sep 17 00:00:00 2001 From: Simon Kelley Date: Sat, 10 Mar 2018 20:44:17 +0000 Subject: [PATCH] Fix compiler warning. --- src/crypto.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/crypto.c b/src/crypto.c index 5becfb0..9e0e562 100644 --- a/src/crypto.c +++ b/src/crypto.c @@ -109,8 +109,6 @@ static struct nettle_hash null_hash = { /* Find pointer to correct hash function in nettle library */ const struct nettle_hash *hash_find(char *name) { - int i; - if (!name) return NULL; @@ -125,13 +123,15 @@ const struct nettle_hash *hash_find(char *name) #if (NETTLE_VERSION_MAJOR>3) || ((NETTLE_VERSION_MAJOR==3) && (NETTLE_VERSION_MINOR >=4)) return nettle_lookup_hash(name); #else - for (i = 0; nettle_hashes[i]; i++) - { + { + int i; + + for (i = 0; nettle_hashes[i]; i++) if (strcmp(nettle_hashes[i]->name, name) == 0) return nettle_hashes[i]; - } - - return NULL; + } + + return NULL; #endif }