if( Offset )
{
int len;
- if(rem_len > BYTES_PER_TRACK-Offset)
+ if(rem_len > BYTES_PER_TRACK - Offset)
len = BYTES_PER_TRACK - Offset;
else
len = rem_len;
track ++;
}
- while( rem_len > BYTES_PER_TRACK )
+ if( rem_len > 0)
{
- FDD_int_ReadWriteWithinTrack(disk, track, 0, 0, BYTES_PER_TRACK, dest);
- dest += BYTES_PER_TRACK;
- rem_len -= BYTES_PER_TRACK;
- track ++;
- }
+ while( rem_len > BYTES_PER_TRACK )
+ {
+ FDD_int_ReadWriteWithinTrack(disk, track, 0, 0, BYTES_PER_TRACK, dest);
+ dest += BYTES_PER_TRACK;
+ rem_len -= BYTES_PER_TRACK;
+ track ++;
+ }
- FDD_int_ReadWriteWithinTrack(disk, track, 0, 0, rem_len, dest);
+ FDD_int_ReadWriteWithinTrack(disk, track, 0, 0, rem_len, dest);
+ }
LEAVE('X', Length);
return Length;
if( Offset + Length > BYTES_PER_TRACK )
return 1;
+ if( Length == 0 )
+ return 0;
+
ENTER("iDisk iTrack bbWrite xOffset xLength pBuffer",
Disk, Track, bWrite, Offset, Length, Buffer);