summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2020-01-14 22:18:12 +0100
committerDaniel Stenberg <daniel@haxx.se>2020-01-14 22:18:12 +0100
commit90b1fb7e3f873529c2041e7e5e97c23b76332477 (patch)
tree817515de6f8439e574979ab6ff2b69a5e3f77218
parentbe578eea7e4d97a3c74fc7e1341ee258925e08ff (diff)
downloadcurl-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.c3
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)