Skip to content

Commit

Permalink
prevent segfaults with mouse cheese
Browse files Browse the repository at this point in the history
  • Loading branch information
scheres committed Sep 20, 2024
1 parent 22c6ee1 commit dfea290
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/time.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,15 +170,15 @@ void progress_bar(long rlen)
while (i--)
fprintf(stdout, ".");
fprintf(stdout, "~~(,_,\">");
if (rlen == totlen)
if (rlen >= totlen)
{
fprintf(stdout, " yum!\n");
totlen = 0;
}
else
{
i = (int)(60 * (float)(totlen - rlen) / totlen);
const char* cheese;
const char* cheese = "";
if (i >= 3) cheese = "[oo]";
else if (i==2) cheese = "oo]";
else if (i==1) cheese = "o]";
Expand Down

0 comments on commit dfea290

Please sign in to comment.