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-16 08:45:25 +0100
commitc2feed05bca2a95b4841a71e66c2f7f935386fa9 (patch)
tree4d15a57d0b8c6d79c3337859afc249b5baa48582
parent68403cdbc6325bcbe4e4128c263db5d04a3c77c6 (diff)
downloadcurl-c2feed05bca2a95b4841a71e66c2f7f935386fa9.tar.gz
curl:progressbarinit: ignore column width from terminals < 20
To avoid division by zero - or other issues. Reported-by: Daniel Marjamäki Closes #4818
-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)