aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2010-10-08 18:53:09 +0200
committerThomas White <taw@physics.org>2012-02-22 15:27:02 +0100
commit970f842a298a0300ed723a8250f7d2c506393e95 (patch)
treef56e2603df794c9c00d7b7321bba6026d56acfc5
parent1235c59a99de33fd9e97538e2135bdd5c958ee9c (diff)
Fix progress_bar() when total=0
-rw-r--r--src/utils.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/utils.c b/src/utils.c
index 196cda3f..99a2dd75 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -60,6 +60,8 @@ void progress_bar(int val, int total, const char *text)
char s[1024];
const int width = 50;
+ if ( total == 0 ) return;
+
if ( !isatty(STDERR_FILENO) ) return;
if ( tcgetpgrp(STDERR_FILENO) != getpgrp() ) return;