From 4719a5d55b529e33046a39db53672d7610767614 Mon Sep 17 00:00:00 2001 From: Sergey Poznyakoff Date: Thu, 13 Jan 2005 15:59:26 +0000 Subject: [PATCH] Use memset instead of bzero, memmove (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 | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/list.c b/src/list.c index a62c706..ee8bd72 100644 --- a/src/list.c +++ b/src/list.c @@ -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 (); -- 2.44.0