diff -ur squashfs4.0.orig/squashfs-tools/unsquashfs.c squashfs4.0/squashfs-tools/unsquashfs.c --- squashfs4.0.orig/squashfs-tools/unsquashfs.c 2009-11-05 11:03:12.758230152 -0500 +++ squashfs4.0/squashfs-tools/unsquashfs.c 2009-11-05 11:21:23.334211515 -0500 @@ -1871,13 +1871,19 @@ void progress_bar(long long current, long long max, int columns) { + char rotate_list[] = { '|', '/', '-', '\\' }; - int max_digits = floor(log10(max)) + 1; - int used = max_digits * 2 + 11; - int hashes = (current * (columns - used)) / max; - int spaces = columns - used - hashes; + int max_digits, used, hashes, spaces; static int tty = -1; + if (max == 0) + return; + + max_digits = floor(log10(max)) + 1; + used = max_digits * 2 + 11; + hashes = (current * (columns - used)) / max; + spaces = columns - used - hashes; + if((current > max) || (columns - used < 0)) return;