summaryrefslogtreecommitdiffstats
path: root/programs/lz4io.c
diff options
context:
space:
mode:
authorYann Collet <cyan@fb.com>2020-08-27 06:20:28 (GMT)
committerYann Collet <cyan@fb.com>2020-08-27 06:20:28 (GMT)
commit3e3a006c6f3337be4298e2c01ba3cb2c0ba04d45 (patch)
tree402305c0d06ccad0faec793b0889010bf3ae9fce /programs/lz4io.c
parentf18dbeb8b54917cbc7a2417413c84604ee0b81f5 (diff)
parentb73cd37baba01229fb67a7aaae9e95fcffd09059 (diff)
downloadlz4-3e3a006c6f3337be4298e2c01ba3cb2c0ba04d45.zip
lz4-3e3a006c6f3337be4298e2c01ba3cb2c0ba04d45.tar.gz
lz4-3e3a006c6f3337be4298e2c01ba3cb2c0ba04d45.tar.bz2
Merge branch 'dev' into extraInput
Diffstat (limited to 'programs/lz4io.c')
-rw-r--r--programs/lz4io.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/programs/lz4io.c b/programs/lz4io.c
index 7926b20..0f3507e 100644
--- a/programs/lz4io.c
+++ b/programs/lz4io.c
@@ -680,7 +680,7 @@ LZ4IO_compressFilename_extRess(LZ4IO_prefs_t* const io_prefs, cRess_t ress,
prefs.frameInfo.contentChecksumFlag = (LZ4F_contentChecksum_t)io_prefs->streamChecksum;
prefs.favorDecSpeed = io_prefs->favorDecSpeed;
if (io_prefs->contentSizeFlag) {
- U64 const fileSize = UTIL_getFileSize(srcFileName);
+ U64 const fileSize = UTIL_getOpenFileSize(srcFile);
prefs.frameInfo.contentSize = fileSize; /* == 0 if input == stdin */
if (fileSize==0)
DISPLAYLEVEL(3, "Warning : cannot determine input content size \n");
@@ -1472,7 +1472,7 @@ LZ4IO_getCompressedFileInfo(LZ4IO_cFileInfo_t* cfinfo, const char* input_filenam
LZ4IO_infoResult result = LZ4IO_format_not_known; /* default result (error) */
unsigned char buffer[LZ4F_HEADER_SIZE_MAX];
FILE* const finput = LZ4IO_openSrcFile(input_filename);
- cfinfo->fileSize = UTIL_getFileSize(input_filename);
+ cfinfo->fileSize = (finput == NULL) ? 0 : UTIL_getOpenFileSize(finput);
while (!feof(finput)) {
LZ4IO_frameInfo_t frameInfo = LZ4IO_INIT_FRAMEINFO;