summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYann Collet <cyan@fb.com>2019-04-22 22:24:44 (GMT)
committerYann Collet <cyan@fb.com>2019-04-22 22:24:44 (GMT)
commit5a50247d5feb0b25d1869ab72bd8f6834e0d4585 (patch)
tree1d126e92ed6b657803567ce72d9b02a0fa8390d7
parenta685d5cffc26c9624c65521d26cba950e59c4cb3 (diff)
downloadlz4-5a50247d5feb0b25d1869ab72bd8f6834e0d4585.zip
lz4-5a50247d5feb0b25d1869ab72bd8f6834e0d4585.tar.gz
lz4-5a50247d5feb0b25d1869ab72bd8f6834e0d4585.tar.bz2
updated code comments
-rw-r--r--programs/lz4io.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/programs/lz4io.c b/programs/lz4io.c
index 5393cd0..105718d 100644
--- a/programs/lz4io.c
+++ b/programs/lz4io.c
@@ -1295,9 +1295,9 @@ typedef struct {
typedef enum { LZ4IO_LZ4F_OK, LZ4IO_format_not_known, LZ4IO_not_a_file } LZ4IO_infoResult;
/* This function is limited,
- * it only works fine for a file consisting of a single valid frame.
- * It will / may stop program execution if a single filename is wrong.
+ * it only works fine for a file consisting of a single valid frame using LZ4 Frame specification.
* It will not look at content beyond first frame header.
+ * It's also unable to parse legacy frames, nor skippable ones.
*
* Things to improve :
* - check the entire file for additional content after first frame
@@ -1311,7 +1311,7 @@ LZ4IO_getCompressedFileInfo(LZ4IO_cFileInfo_t* cfinfo, const char* input_filenam
LZ4IO_infoResult result = LZ4IO_format_not_known; /* default result (error) */
if (!UTIL_isRegFile(input_filename)) return LZ4IO_not_a_file;
- cfinfo->fileSize = UTIL_getFileSize(input_filename); /* returns 0 if cannot read information */
+ cfinfo->fileSize = UTIL_getFileSize(input_filename);
/* Get filename without path prefix */
{ const char* b = strrchr(input_filename, '/');
@@ -1329,9 +1329,10 @@ LZ4IO_getCompressedFileInfo(LZ4IO_cFileInfo_t* cfinfo, const char* input_filenam
/* Read file and extract header */
{ size_t const hSize = LZ4F_HEADER_SIZE_MAX;
size_t readSize=0;
- void* const buffer = malloc(hSize);
+ void* const buffer = malloc(hSize);
if (!buffer) EXM_THROW(21, "Allocation error : not enough memory");
+
{ FILE* const finput = LZ4IO_openSrcFile(input_filename);
if (finput) {
readSize = fread(buffer, 1, hSize, finput);