Write this the other way around, because it's easier to read that way.
And then notice that it's broken because it doesn't actually set the
return value properly.
else bad_hi = pos + n + 1;
}
recovered(bad_lo, bad_hi); *pos_inout = good;
else bad_hi = pos + n + 1;
}
recovered(bad_lo, bad_hi); *pos_inout = good;
- if (r.pos + r.start <= good && good <= r.pos + r.end) {
- rearrange_sectors(&r, 0, good - r.pos, r.pos + r.end - good);
- } else
+ if (good < r.pos + r.start || r.pos + r.end <= good)
+ else {
+ n = r.pos + r.end - good;
+ rearrange_sectors(&r, 0, good - r.pos, n);
+ }