From d39531ff554b19fefaeb9e3e08865fba1485b311 Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Mon, 15 Feb 2016 11:06:37 +0000 Subject: Ensure fetch attempts is not reduced to less than 1. --- utils/nsoption.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'utils/nsoption.c') diff --git a/utils/nsoption.c b/utils/nsoption.c index b23bd8764..387d7c704 100644 --- a/utils/nsoption.c +++ b/utils/nsoption.c @@ -192,8 +192,9 @@ static void nsoption_validate(struct nsoption_s *opts, struct nsoption_s *defs) opts[NSOPTION_curl_fetch_timeout].value.u = 5; if (opts[NSOPTION_curl_fetch_timeout].value.u > 60) opts[NSOPTION_curl_fetch_timeout].value.u = 60; - while ((opts[NSOPTION_curl_fetch_timeout].value.u * - opts[NSOPTION_max_retried_fetches].value.u) > 60) + while (((opts[NSOPTION_curl_fetch_timeout].value.u * + opts[NSOPTION_max_retried_fetches].value.u) > 60) && + (opts[NSOPTION_max_retried_fetches].value.u > 1)) opts[NSOPTION_max_retried_fetches].value.u--; } -- cgit v1.2.3