]> Dogcows Code - chaz/tar/commitdiff
Use memset instead of bzero, memmove
authorSergey Poznyakoff <gray@gnu.org.ua>
Thu, 13 Jan 2005 15:59:26 +0000 (15:59 +0000)
committerSergey Poznyakoff <gray@gnu.org.ua>
Thu, 13 Jan 2005 15:59:26 +0000 (15:59 +0000)
(or memcpy, if appropriate), instead of bcopy, and
strchr/strrchr instead of index/rindex.
Rename isnumber to isnumber_p. Proposed by Albert Chin.

src/list.c

index a62c706261a58ca142f19e9fb532c802b4328a6b..ee8bd72f7642a027639f829628573d10b9f15923 100644 (file)
@@ -1,7 +1,7 @@
 /* List a tar archive, with support routines for reading a tar archive.
 
    Copyright (C) 1988, 1992, 1993, 1994, 1996, 1997, 1998, 1999, 2000,
-   2001, 2003, 2004 Free Software Foundation, Inc.
+   2001, 2003, 2004, 2005 Free Software Foundation, Inc.
 
    Written by John Gilmore, on 1985-08-26.
 
@@ -378,7 +378,11 @@ read_header (bool raw_extended_headers)
                   || header->header.typeflag == GNUTYPE_LONGLINK)
            {
              size_t name_size = current_stat_info.stat.st_size;
-             size = name_size - name_size % BLOCKSIZE + 2 * BLOCKSIZE;
+             size_t n = name_size % BLOCKSIZE;
+             size = name_size + BLOCKSIZE;
+             if (n)
+               size += BLOCKSIZE - n;
+             
              if (name_size != current_stat_info.stat.st_size
                  || size < name_size)
                xalloc_die ();
This page took 0.023871 seconds and 4 git commands to generate.