summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--timer.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/timer.c b/timer.c
index ad479e7..d361d0b 100644
--- a/timer.c
+++ b/timer.c
@@ -14,7 +14,7 @@ int main(int argc, char** argv){
}
sscanf(argv[1], "%d:%d", &min, &sec);
int time = min*60 + sec;
- for (int j = 0; j<times; j++){
+ for (int j = 0; times==0 || j<times; j++){
for (int i = 1; i<=time; i++){
printf("%d:%02d/%d:%02d\r", (i-i%60)/60, i%60, min, sec);
fflush(stdout);