summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Drake <michael.drake@codethink.co.uk>2016-02-15 11:06:37 +0000
committerMichael Drake <michael.drake@codethink.co.uk>2016-02-15 11:06:37 +0000
commitd39531ff554b19fefaeb9e3e08865fba1485b311 (patch)
tree9f10c25bb6b40430f4e04f698a1897aa8cd978fa
parent6b57c94012201c974693dcd7fe53a070f8fc66e2 (diff)
downloadnetsurf-d39531ff554b19fefaeb9e3e08865fba1485b311.tar.gz
netsurf-d39531ff554b19fefaeb9e3e08865fba1485b311.tar.bz2
Ensure fetch attempts is not reduced to less than 1.
-rw-r--r--utils/nsoption.c5
1 files changed, 3 insertions, 2 deletions
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--;
}