From c2feed05bca2a95b4841a71e66c2f7f935386fa9 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 14 Jan 2020 22:18:12 +0100 Subject: curl:progressbarinit: ignore column width from terminals < 20 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 Closes #4818 --- 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.3