X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=src%2Fcreate.c;h=5bc51ae6f1f6a1171771b99a2f6ee7acadb4861a;hb=6dccec3ba45c8c5052be0dacb7c4766662ed30fc;hp=9bd4dead7b940c5904f8b7e7efaf6f9303e104cc;hpb=619a95af98c8bab14dfad12c6f9db2367ba8f8af;p=chaz%2Ftar diff --git a/src/create.c b/src/create.c index 9bd4dea..5bc51ae 100644 --- a/src/create.c +++ b/src/create.c @@ -298,7 +298,7 @@ clear_buffer (char *buffer) } /*-------------------------------------------------------------------------. -| Write the EOT block(s). We actually zero at least one block, through | +| Write the EOT block(s). We zero at least two blocks, through | | the end of the record. Old tar, as previous versions of GNU tar, writes | | garbage after two zeroed blocks. | `-------------------------------------------------------------------------*/ @@ -307,14 +307,11 @@ void write_eot (void) { union block *pointer = find_next_block (); - - if (pointer) - { - size_t space = available_space_after (pointer); - - memset (pointer->buffer, 0, space); - set_next_block_after (pointer); - } + memset (pointer->buffer, 0, BLOCKSIZE); + set_next_block_after (pointer); + pointer = find_next_block (); + memset (pointer->buffer, 0, available_space_after (pointer)); + set_next_block_after (pointer); } /*-----------------------------------------------------. @@ -766,8 +763,8 @@ finish_sparse_file (int file, off_t *sizeleft, off_t fullsize, char *name) if (count < 0) { char buf[UINTMAX_STRSIZE_BOUND]; - ERROR ((0, errno, _("\ -Read error at byte %s, reading %lu bytes, in file %s"), + ERROR ((0, errno, + _("Read error at byte %s, reading %lu bytes, in file %s"), STRINGIFY_BIGINT (fullsize - *sizeleft, buf), (unsigned long) bufsize, name)); return 1; @@ -1281,8 +1278,8 @@ dump_file (char *p, dev_t parent_device, int top_level) if (count < 0) { char buf[UINTMAX_STRSIZE_BOUND]; - ERROR ((0, errno, _("\ -Read error at byte %s, reading %lu bytes, in file %s"), + ERROR ((0, errno, + _("Read error at byte %s, reading %lu bytes, in file %s"), STRINGIFY_BIGINT (current_stat.st_size - sizeleft, buf), (unsigned long) bufsize, p));