Commit 80c932d8 authored by Mike Hibler's avatar Mike Hibler

The constructed valid block list was not properly terminated in the

case where the end of the partition was allocated (instead of free).

Added a little debug output.
parent 20b2ff9e
......@@ -1263,6 +1263,7 @@ makeranges(void)
{
struct range *pskip, *ptmp, *range, *lastrange = 0;
unsigned long offset;
unsigned long total = 0;
if (!skips)
return;
......@@ -1286,6 +1287,7 @@ makeranges(void)
range->size = pskip->start - offset;
range->next = 0;
offset = pskip->start + pskip->size;
total += range->size;
if (lastrange)
lastrange->next = range;
......@@ -1321,6 +1323,9 @@ makeranges(void)
}
else
range->size = 0;
range->next = 0;
total += range->size;
lastrange->next = range;
lastrange = range;
numranges++;
......@@ -1333,6 +1338,9 @@ makeranges(void)
" %12d %9d\n", range->start, range->size);
range = range->next;
}
fprintf(stderr,
"\nTotal Number of Valid Sectors: %d (bytes %qd)\n",
total, (off_t)total * (off_t)secsize);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment