From a330806e4b78f981b681bba57c9667cc8fc4cd19 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Fri, 5 Jul 2019 16:48:28 +0200 Subject: [PATCH] dh_crypto: Use size_t for loop variable Also don't declare the variable in the loop. Fixes #157 Signed-off-by: Andreas Schneider Reviewed-by: Jakub Jelen (cherry picked from commit 2884f97bc5d3ea23e609ebd789b9c1d3e79764b3) --- src/dh_crypto.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/dh_crypto.c b/src/dh_crypto.c index 56a76fab..0ccc3641 100644 --- a/src/dh_crypto.c +++ b/src/dh_crypto.c @@ -96,12 +96,14 @@ int ssh_dh_get_parameters(struct dh_ctx *ctx, int ssh_dh_set_parameters(struct dh_ctx *ctx, const bignum modulus, const bignum generator) { + size_t i; int rc; if ((ctx == NULL) || (modulus == NULL) || (generator == NULL)) { return SSH_ERROR; } - for (int i = 0; i < 2; i++) { + + for (i = 0; i < 2; i++) { bignum p = NULL; bignum g = NULL;