Imported Upstream version 2.5.2p1
[debian/amanda] / common-src / statfs.c
index 9e1d3cd1932cd190f5a3bc766093c558a9745f83..6f3e26ac158cbf95c39f37a6efeede697f26840d 100644 (file)
@@ -137,7 +137,9 @@ scale(
 {
     if (r == (off_t)-1)
        return (off_t)-1;
-    return r*(s/(off_t)1024);
+    if (s % 1024 == 0)
+       return r*(s/(off_t)1024);
+    return (off_t)(r*((double)s/1024.0));
 }
 
 int
@@ -191,10 +193,10 @@ main(
 
     printf("statfs (%s)\n",STATFS_TYP);
     printf(
-"name                             total    free   avail  files  ffree favail\n"
+"name                            total     free    avail   files   ffree  favail\n"
           );
     printf(
-"------------------------------ ------- ------- ------- ------ ------ ------\n"
+"---------------------------- -------- -------- -------- ------- ------- -------\n"
           );
 
     do {
@@ -203,7 +205,7 @@ main(
            perror(*argv);
            continue;
        }
-       printf("%-30.30s %7ld %7ld %7ld %6ld %6ld %6ld\n", *argv,
+       printf("%-28.28s %8ld %8ld %8ld %7ld %7ld %7ld\n", *argv,
               statbuf.total, statbuf.free, statbuf.avail,
               statbuf.files, statbuf.ffree, statbuf.favail);
     } while(argc > 1);