[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: fwrite problems and bringing down MiNT



apc@abcj.demon.co.uk%INTERNET wrote:
> 
> Hi,
>       I was updating some code recently and accidentally ended up with a
> negative number of 'bits' of information to write.  This had two results
> when the program was run:
> 
> 1.    (Without Memory Protection)  it hit the disk continuously wiping out
> my minix partition (or was this that I switched off my Falcon while the file
> was being updated - I don't think so).

This sounds like GEMDOS is passing a negative value for "count" to
Rwabs.
This is probably caused by the TOS GEMDOS and should be fixed in both
TOSFS and the new VFATFS.

Besides, HD drivers could do a sanity check on the value for "count" as
well.


> Is this how fwrite should behave?  Wouldn't it be better to catch this and
> return zero bits of information written.  Also don't know what happens if
> fwrite is asked to write zero bits of information.

That should be handled gracefully.

Regards, jr