]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
(copy_reg): Use `ST_NBLOCKS (sb) * 512', not `sb.st_blocks *
authorJim Meyering <jim@meyering.net>
Wed, 3 Apr 1996 12:20:24 +0000 (12:20 +0000)
committerJim Meyering <jim@meyering.net>
Wed, 3 Apr 1996 12:20:24 +0000 (12:20 +0000)
DEV_BSIZE.'  From H.J. Lu (hjl@lucon.org).

src/cp.c

index bb03ff6ae1fbfd72a1d17ca9b3086cc1de30e3b9..a44046abed035a5edeb807b2581f47cba110ee8b 100644 (file)
--- a/src/cp.c
+++ b/src/cp.c
@@ -1242,7 +1242,7 @@ copy_reg (char *src_path, char *dst_path)
         be needed for a file of its size, then
         at least one of the blocks in the file is a hole. */
       /* FIXME: isn't there risk of overflow here?  */
-      if (S_ISREG (sb.st_mode) && sb.st_size > sb.st_blocks * DEV_BSIZE)
+      if (S_ISREG (sb.st_mode) && sb.st_size > ST_NBLOCKS (sb) * 512)
        make_holes = 1;
     }
 #endif