Hi.  I've found a bug in lib/human.c in fileutils-4.0, relating to large
file support.

Before applying the patch (attached), ls -alF reports the following:

total 3002960
drwxr-xr-x   3 root     root         4096 Aug 22 09:46 ./
drwxr-xr-x   8 root     root         4096 Aug 22 06:26 ../
-rw-r--r--   1 root     root     18446744072486584320 Aug 22 06:38
3gigfile
drwxr-xr-x   2 root     root        16384 Aug 21 00:57 lost+found/


After the patch:

total 3002960
drwxr-xr-x   3 root     root         4096 Aug 22 09:46 ./
drwxr-xr-x   8 root     root         4096 Aug 22 06:26 ../
-rw-r--r--   1 root     root     3072000000 Aug 22 06:38 3gigfile
drwxr-xr-x   2 root     root        16384 Aug 21 00:57 lost+found/



        PinkFreud  [Mike Edwards]

Brainbench certified Master Linux Administrator
http://www.brainbench.com/transcript.jsp?pid=158188
-----------------------------------
Unsolicited advertisments to this address are not welcome.
--- fileutils-4.0/lib.old/human.c       Wed Jul 22 14:29:46 1998
+++ fileutils-4.0/lib/human.c   Sat Aug 26 23:21:08 2000
@@ -172,9 +172,9 @@
     }
   else
     {
-      int divisor = to_block_size / from_block_size;
-      int r10 = (n % divisor) * 10;
-      int r2 = (r10 % divisor) * 2;
+      unsigned int divisor = to_block_size / from_block_size;
+      unsigned int r10 = (n % divisor) * 10;
+      unsigned int r2 = (r10 % divisor) * 2;
       amt = n / divisor;
       tenths = r10 / divisor;
       rounding = r2 < divisor ? 0 < r2 : 2 + (divisor < r2);

Reply via email to