diff options
Diffstat (limited to 'archival')
-rw-r--r-- | archival/tar.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/archival/tar.c b/archival/tar.c index 432355353..adcedf615 100644 --- a/archival/tar.c +++ b/archival/tar.c | |||
@@ -28,6 +28,8 @@ | |||
28 | #include "libbb.h" | 28 | #include "libbb.h" |
29 | #include "unarchive.h" | 29 | #include "unarchive.h" |
30 | 30 | ||
31 | #define block_buf bb_common_bufsiz1 | ||
32 | |||
31 | #if ENABLE_FEATURE_TAR_CREATE | 33 | #if ENABLE_FEATURE_TAR_CREATE |
32 | 34 | ||
33 | /* Tar file constants */ | 35 | /* Tar file constants */ |
@@ -475,8 +477,8 @@ static int writeFileToTarball(const char *fileName, struct stat *statbuf, | |||
475 | /* Pad the file up to the tar block size */ | 477 | /* Pad the file up to the tar block size */ |
476 | /* (a few tricks here in the name of code size) */ | 478 | /* (a few tricks here in the name of code size) */ |
477 | readSize = (-(int)statbuf->st_size) & (TAR_BLOCK_SIZE-1); | 479 | readSize = (-(int)statbuf->st_size) & (TAR_BLOCK_SIZE-1); |
478 | memset(bb_common_bufsiz1, 0, readSize); | 480 | memset(block_buf, 0, readSize); |
479 | xwrite(tbInfo->tarFd, bb_common_bufsiz1, readSize); | 481 | xwrite(tbInfo->tarFd, block_buf, readSize); |
480 | } | 482 | } |
481 | 483 | ||
482 | return TRUE; | 484 | return TRUE; |
@@ -570,8 +572,8 @@ static int writeTarFile(const int tar_fd, const int verboseFlag, | |||
570 | include = include->link; | 572 | include = include->link; |
571 | } | 573 | } |
572 | /* Write two empty blocks to the end of the archive */ | 574 | /* Write two empty blocks to the end of the archive */ |
573 | memset(bb_common_bufsiz1, 0, 2*TAR_BLOCK_SIZE); | 575 | memset(block_buf, 0, 2*TAR_BLOCK_SIZE); |
574 | xwrite(tbInfo.tarFd, bb_common_bufsiz1, 2*TAR_BLOCK_SIZE); | 576 | xwrite(tbInfo.tarFd, block_buf, 2*TAR_BLOCK_SIZE); |
575 | 577 | ||
576 | /* To be pedantically correct, we would check if the tarball | 578 | /* To be pedantically correct, we would check if the tarball |
577 | * is smaller than 20 tar blocks, and pad it if it was smaller, | 579 | * is smaller than 20 tar blocks, and pad it if it was smaller, |