From 90b1fb7e3f873529c2041e7e5e97c23b76332477 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 14 Jan 2020 22:18:12 +0100 Subject: progressbarinit: refuse narrower terminals than 20 columns MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit To avoid division by zero - or other issues. Reported-by: Daniel Marjamäki --- src/tool_cb_prg.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/tool_cb_prg.c b/src/tool_cb_prg.c index 9d16ec766..d4c146590 100644 --- a/src/tool_cb_prg.c +++ b/src/tool_cb_prg.c @@ -251,7 +251,8 @@ void progressbarinit(struct ProgressData *bar, } } #endif /* TIOCGSIZE */ - bar->width = cols; + if(cols > 20) + bar->width = cols; } if(!bar->width) -- cgit v1.2.1