summaryrefslogtreecommitdiffstats
path: root/main.cc
diff options
context:
space:
mode:
Diffstat (limited to 'main.cc')
-rw-r--r--main.cc11
1 files changed, 6 insertions, 5 deletions
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 );