prevent division-by-zero in progress bar

This commit is contained in:
Olaf Rempel 2020-02-01 21:58:04 +01:00
parent c4f55407bc
commit 9d1fdb5c4c
1 changed files with 2 additions and 2 deletions

View File

@ -82,7 +82,7 @@ static void progress_mode0_cb(const char *msg, int pos, int size)
* ************************************************************************* */
static void progress_mode1_cb(const char *msg, int pos, int size)
{
if (pos != -1 && size != -1)
if (pos != -1 && size > 0)
{
char stars[51];
int i;
@ -111,7 +111,7 @@ static void progress_mode2_cb(const char *msg, int pos, int size)
{
static int old_count;
if (pos != -1 && size != -1)
if (pos != -1 && size > 0)
{
if (pos == 0)
{