From 0defae2fe524230f8b818d406d19e56f360bcc54 Mon Sep 17 00:00:00 2001
From: Daniel Stenberg <daniel@haxx.se>
Date: Sat, 2 Jul 2022 00:02:04 +0200
Subject: [PATCH] tool_progress: avoid division by zero in parallel progress
 meter

Reported-by: Brian Carpenter
Fixes #9082
Closes #9083

Conflict: NA
Reference: https://github.com/curl/curl/commit/0defae2fe524230f8b818d406d19e56f360bcc54
---
 src/tool_progress.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/tool_progress.c b/src/tool_progress.c
index da5317b92..46185c0d3 100644
--- a/src/tool_progress.c
+++ b/src/tool_progress.c
@@ -268,6 +268,8 @@ bool progress_meter(struct GlobalConfig *global,
         dl = all_dlnow;
         ul = all_ulnow;
       }
+      if(!deltams) /* no division by zero please */
+        deltams++;
       dls = (curl_off_t)((double)dl / ((double)deltams/1000.0));
       uls = (curl_off_t)((double)ul / ((double)deltams/1000.0));
       speed = dls > uls ? dls : uls;
-- 
2.33.0

