Fix bug in progress info, count last written bytes in percent.

This commit is contained in:
Vreixo Formoso 2007-12-30 18:05:35 +01:00
parent 48e243d5da
commit c786fc70b6
1 changed files with 7 additions and 5 deletions

View File

@ -965,11 +965,13 @@ int iso_write(Ecma119Image *target, void *buf, size_t count)
}
if (ret > 0){
unsigned int kbw = (unsigned int) target->bytes_written >> 10;
unsigned int kbt = (unsigned int) target->total_size >> 10;
int percent = (kbw * 100) / kbt;
unsigned int kbw, kbt;
int percent;
target->bytes_written += count;
kbw = (unsigned int) target->bytes_written >> 10;
kbt = (unsigned int) target->total_size >> 10;
percent = (kbw * 100) / kbt;
/* only report in 5% chunks */
if (percent >= target->percent_written + 5) {