@ -4,12 +4,16 @@
void draw_progress(FILE *fp, unsigned long pos, unsigned long max)
{
unsigned long head = (TERM_WIDTH - 2) * pos / max;
unsigned long i;
unsigned long head, i;
if (pos > max)
pos = max;
head = (TERM_WIDTH - 2) * pos / max;
fputc('[', fp);
for (i = 0; i <= head; ++i)
for (i = 0; i < head; ++i)
fputc('#', fp);
for (; i < (TERM_WIDTH - 2); ++i)