Hi!

27-Июл-2005 16:27 [EMAIL PROTECTED] (Kenneth Davis) wrote to
[EMAIL PROTECTED]:

KD> +++ dir.c   27 Jul 2005 16:27:22 -0000      1.23
KD>     clustersize = FAT32_Free_Space.sectors_per_cluster
KD>      * FAT32_Free_Space.bytes_per_sector;
KD> +       if (clustersize)
KD> +          if (FAT32_Free_Space.free_clusters >= 0x80000000l / clustersize)
-----------------------------------------------------^^^-------^

     Should be `ul', else there is signed division. Or, use "> LONG_MAX /
clustersize" (where LONG_MAX defined in limits.h as 0x7FFFFFFFl).

KD> +                {
KD> +                int shift;
KD> +                for (shift = 21; --shift;)
KD> +                        {
KD> +                        if ((clustersize & 1) == 0) clustersize >>= 1;
KD> +                        else FAT32_Free_Space.free_clusters >>= 1;
KD> +                        }

     After this loop clustersize==1...

KD> +                convert(FAT32_Free_Space.free_clusters * clustersize, 
buffer);

...so this multiplication equal to ".free_clusters * 1". Forgeted to
eliminate multiplication?




-------------------------------------------------------
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_idt77&alloc_id492&op=click
_______________________________________________
Freedos-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freedos-devel

Reply via email to