diff options
Diffstat (limited to 'programs')
-rw-r--r-- | programs/lz4io.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/programs/lz4io.c b/programs/lz4io.c index 19db03b..d92634a 100644 --- a/programs/lz4io.c +++ b/programs/lz4io.c @@ -876,9 +876,11 @@ static unsigned long long LZ4IO_decompressLZ4F(dRess_t ress, FILE* srcFile, FILE } +#define PTSIZE (64 KB) +#define PTSIZET (PTSIZE / sizeof(size_t)) static unsigned long long LZ4IO_passThrough(FILE* finput, FILE* foutput, unsigned char MNstore[MAGICNUMBER_SIZE]) { - void* buffer = malloc(64 KB); + size_t buffer[PTSIZET]; size_t read = 1, sizeCheck; unsigned long long total = MAGICNUMBER_SIZE; unsigned storedSkips = 0; @@ -888,13 +890,12 @@ static unsigned long long LZ4IO_passThrough(FILE* finput, FILE* foutput, unsigne while (read) { - read = fread(buffer, 1, 64 KB, finput); + read = fread(buffer, 1, PTSIZE, finput); total += read; storedSkips = LZ4IO_fwriteSparse(foutput, buffer, read, storedSkips); } LZ4IO_fwriteSparseEnd(foutput, storedSkips); - free(buffer); return total; } |