The rig_tracks function checks for tracks being shorter than the respective track capacity, and then attempts to fill up the short track with 0x55 bytes up to the track's capacity.
However, there is a mistake in the size/count argument for the memset invocation:
The size/count argument should be capacity[track_density[track]&3] - track_length[track] instead of just capacity[track_density[track]&3]. The commented out printf statement got it right... ;-)
The rig_tracks function checks for tracks being shorter than the respective track capacity, and then attempts to fill up the short track with 0x55 bytes up to the track's capacity.
However, there is a mistake in the size/count argument for the memset invocation:
The size/count argument should be
capacity[track_density[track]&3] - track_length[track]
instead of justcapacity[track_density[track]&3]
. The commented out printf statement got it right... ;-)