No, I think (1024*1024)/(64*32768) would be .5, which
is zero in integer division.  :-)  2097152 > 1048576

All they appear to be doing is converting bytes to Megabytes,
so (FAT32_Free_Space.free_clusters * clustersize )/(1024l*1024)
should do it, without yielding 0 all the time (my first
suggestion) and without divide by zero errors.  I don't know
nearly enough to comment on the other issue!

Mark



> > Specifically, the disk is reporting 64 sectors per cluster and
> > 32768 bytes per sector.  This makes ((1024l*1024)/clustersize)
> > evaluate to 0!
> 
> I do not think so. It should evaluate to 32... Still you get less
> danger of overflows by doing e.g.
> 
> FAT32_Free_Space.free_clusters / (2048UL / (clustersize/512))
> 
> Eric
> 


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Freedos-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freedos-devel

Reply via email to