1
0
Fork 0

Merging upstream version 1.17.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-21 11:25:00 +01:00
parent 0b4c623a0a
commit 4d8b7256f0
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
13 changed files with 71 additions and 93 deletions

11
main.cc
View file

@ -145,7 +145,7 @@ void show_version()
} // end namespace
void show_header( const File_header & header )
void show_header( const unsigned dictionary_size )
{
if( verbosity >= 3 )
{
@ -154,7 +154,7 @@ void show_header( const File_header & header )
enum { factor = 1024 };
const char * p = "";
const char * np = " ";
unsigned num = header.dictionary_size();
unsigned num = dictionary_size;
bool exact = ( num % factor == 0 );
for( int i = 0; i < 8 && ( num > 9999 || ( exact && num >= factor ) ); ++i )
@ -488,12 +488,13 @@ int decompress( const int infd, const Pretty_print & pp, const bool testing )
header.version() ); }
retval = 2; break;
}
if( header.dictionary_size() < min_dictionary_size ||
header.dictionary_size() > max_dictionary_size )
const unsigned dictionary_size = header.dictionary_size();
if( dictionary_size < min_dictionary_size ||
dictionary_size > max_dictionary_size )
{ pp( "Invalid dictionary size in member header." ); retval = 2; break; }
if( verbosity >= 2 || ( verbosity == 1 && first_member ) )
{ pp(); show_header( header ); }
{ pp(); show_header( dictionary_size ); }
LZ_decoder decoder( header, rdec, outfd );
const int result = decoder.decode_member( pp );