summaryrefslogtreecommitdiffstats
path: root/programs/lz4io.c
diff options
context:
space:
mode:
authorYann Collet <yann.collet.73@gmail.com>2015-04-09 21:59:07 (GMT)
committerYann Collet <yann.collet.73@gmail.com>2015-04-09 21:59:07 (GMT)
commitf344fbd3ca1a0a32668737e79bfdb06f3fadbba7 (patch)
treed6b9e25f27b92d752756df7e755e637c80715908 /programs/lz4io.c
parent2f8a4c32f998e6440a0b580996ecf8f101df2c74 (diff)
downloadlz4-f344fbd3ca1a0a32668737e79bfdb06f3fadbba7.zip
lz4-f344fbd3ca1a0a32668737e79bfdb06f3fadbba7.tar.gz
lz4-f344fbd3ca1a0a32668737e79bfdb06f3fadbba7.tar.bz2
Fixed a few warnings from -fsanitize=undefined
Diffstat (limited to 'programs/lz4io.c')
-rw-r--r--programs/lz4io.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/programs/lz4io.c b/programs/lz4io.c
index 991d9d7..278b766 100644
--- a/programs/lz4io.c
+++ b/programs/lz4io.c
@@ -487,8 +487,15 @@ int LZ4IO_compressFilename(const char* input_filename, const char* output_filena
/* Final Status */
end = clock();
DISPLAYLEVEL(2, "\r%79s\r", "");
- DISPLAYLEVEL(2, "Compressed %llu bytes into %llu bytes ==> %.2f%%\n",
+ if (filesize == 0)
+ {
+ DISPLAYLEVEL(2, "Null size input; converted into %u lz4 stream\n", (unsigned)compressedfilesize);
+ }
+ else
+ {
+ DISPLAYLEVEL(2, "Compressed %llu bytes into %llu bytes ==> %.2f%%\n",
(unsigned long long) filesize, (unsigned long long) compressedfilesize, (double)compressedfilesize/filesize*100);
+ }
{
double seconds = (double)(end - start)/CLOCKS_PER_SEC;
DISPLAYLEVEL(4, "Done in %.2f s ==> %.2f MB/s\n", seconds, (double)filesize / seconds / 1024 / 1024);