facebook / zstd

Zstandard - Fast real-time compression algorithm
http://www.zstd.net
Other
22.77k stars 2.03k forks source link

Warning message for `zstd -v --train` is missing line breaks #4052

Closed dearblue closed 1 month ago

dearblue commented 1 month ago

Describe the bug

The warning message for zstd -v --train when exceeding 128 KiB is missing line breaks.

To Reproduce

  1. Install zstd-1.5.6
  2. Change directory to zstd clone repository
  3. Enter the /usr/local/bin/zstd -v --train lib/legacy/*.c

Expected behavior

% /usr/local/bin/zstd -v --train lib/legacy/*.c
*** Zstandard CLI (64-bit) v1.5.6, by Yann Collet ***
Shuffling input files
Sample file 'lib/legacy/zstd_v04.c' is too large, limiting to 128 KB
Sample file 'lib/legacy/zstd_v06.c' is too large, limiting to 128 KB
Sample file 'lib/legacy/zstd_v07.c' is too large, limiting to 128 KB
Sample file 'lib/legacy/zstd_v05.c' is too large, limiting to 128 KB
!  Warning : data size of samples too small for target dictionary size
!  Samples should be about 100x larger than target dictionary size

...SNIP...

Screenshots and charts

% /usr/local/bin/zstd -v --train lib/legacy/*.c
*** Zstandard CLI (64-bit) v1.5.6, by Yann Collet ***
Shuffling input files
Sample file 'lib/legacy/zstd_v04.c' is too large, limiting to 128 KBSample file 'lib/legacy/zstd_v06.c' is too large, limiting to 128 KBSample file 'lib/legacy/zstd_v07.c' is too large, limiting to 128 KBSample file 'lib/legacy/zstd_v05.c' is too large, limiting to 128 KB!  Warning : data size of samples too small for target dictionary size
!  Samples should be about 100x larger than target dictionary size

...SNIP...

Desktop (please complete the following information):

Additional context

https://github.com/facebook/zstd/blob/0e2ceb2d5061f3a8357d124029ebaae16d915a3d/programs/dibio.c#L301