]> Dogcows Code - chaz/tar/commitdiff
(write_eot): Write at least two zero blocks.
authorPaul Eggert <eggert@cs.ucla.edu>
Wed, 18 Aug 1999 07:52:26 +0000 (07:52 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Wed, 18 Aug 1999 07:52:26 +0000 (07:52 +0000)
src/create.c

index 81066b4dcfac4805e4147a8fafcac814ddc283e4..5bc51ae6f1f6a1171771b99a2f6ee7acadb4861a 100644 (file)
@@ -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);
 }
 
 /*-----------------------------------------------------.
This page took 0.02724 seconds and 4 git commands to generate.