diff options
author | Matt Kraai | 2001-07-10 15:05:39 +0000 |
---|---|---|
committer | Matt Kraai | 2001-07-10 15:05:39 +0000 |
commit | 5710f9f690c5b668a916da8b2bcee8bbe63e6394 (patch) | |
tree | bf10b40d9d55a084488e4b34044b45817a2da278 /tar.c | |
parent | 654944fc36ba2dd9de782b3c0c6d0e0f050104c2 (diff) | |
download | busybox-5710f9f690c5b668a916da8b2bcee8bbe63e6394.zip busybox-5710f9f690c5b668a916da8b2bcee8bbe63e6394.tar.gz |
Read 20 512-byte blocks at a time (like GNU tar).
Diffstat (limited to 'tar.c')
-rw-r--r-- | tar.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -330,7 +330,7 @@ tarExtractRegularFile(TarInfo *header, int extractFlag, int tostdoutFlag) size_t writeSize; size_t readSize; size_t actualWriteSz; - char buffer[BUFSIZ]; + char buffer[20 * TAR_BLOCK_SIZE]; size_t size = header->size; int outFd=fileno(stdout); @@ -354,9 +354,9 @@ tarExtractRegularFile(TarInfo *header, int extractFlag, int tostdoutFlag) if ( size > sizeof(buffer) ) writeSize = readSize = sizeof(buffer); else { - int mod = size % 512; + int mod = size % TAR_BLOCK_SIZE; if ( mod != 0 ) - readSize = size + (512 - mod); + readSize = size + (TAR_BLOCK_SIZE - mod); else readSize = size; writeSize = size; |