diff options
author | Daniel Stenberg <daniel@haxx.se> | 2020-01-14 22:18:12 +0100 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2020-01-14 22:18:12 +0100 |
commit | 90b1fb7e3f873529c2041e7e5e97c23b76332477 (patch) | |
tree | 817515de6f8439e574979ab6ff2b69a5e3f77218 | |
parent | be578eea7e4d97a3c74fc7e1341ee258925e08ff (diff) | |
download | curl-bagder/narrow-screen-crash.tar.gz |
progressbarinit: refuse narrower terminals than 20 columnsbagder/narrow-screen-crash
To avoid division by zero - or other issues.
Reported-by: Daniel Marjamäki
-rw-r--r-- | src/tool_cb_prg.c | 3 |
1 files changed, 2 insertions, 1 deletions
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) |