A programmatic time-gap defect correction apparatus and method corrects
errors which may go undetected by a computer system. Buffer underruns or
overruns, which may incur errors in data transfers, yet remain undetected
and uncorrected in a computer system, are corrected by an error avoidance
module in accordance with the invention. Bytes transferred to and from
buffers, used by an I/O controllers to temporarily store data while being
transferred between synchronous and asynchronous devices, are counted and
an error condition is forced based on the count. If the count exceeds the
capacity of the buffer, an error condition is forced, thereby reducing
chances that errors are incurred into the data transfer.