From 92e8b56a5e12ea97fa2763f34c246ca467128b97 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 7 Nov 2015 12:52:02 +0100 Subject: Merging upstream version 1.17. Signed-off-by: Daniel Baumann --- main.cc | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'main.cc') diff --git a/main.cc b/main.cc index a1bf966..9e3774b 100644 --- a/main.cc +++ b/main.cc @@ -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 ); -- cgit v1.2.3