/* sum += i;
if (sum < upperbound)
goto extend;*/
- if (index_offset + i < upperbound)
+ if (index_offset + i <= upperbound)
{
index_offset += i;
exhdr->ext_hdr.isextended++;
* realloc the scratch area, since we've run out of room --
*/
sparsearray = (struct sp_array *)
- realloc (sparsearray,
+ ck_realloc (sparsearray,
2 * sp_array_size * (sizeof (struct sp_array)));
sp_array_size *= 2;
}
}
if (amidst_data)
sparsearray[sparse_ind++].numbytes = numbytes;
+ else
+ {
+ sparsearray[sparse_ind].offset = offset-1;
+ sparsearray[sparse_ind++].numbytes = 1;
+ }
close (fd);
return sparse_ind - 1;