summaryrefslogtreecommitdiffstats
path: root/main.cc
diff options
context:
space:
mode:
authorDaniel Baumann <mail@daniel-baumann.ch>2015-11-07 11:52:02 +0000
committerDaniel Baumann <mail@daniel-baumann.ch>2015-11-07 11:52:02 +0000
commit92e8b56a5e12ea97fa2763f34c246ca467128b97 (patch)
tree143179fb3ede09c4aa3fd48c5dc5fc25ce21d138 /main.cc
parentAdding debian version 1.17~rc2-1. (diff)
downloadlziprecover-92e8b56a5e12ea97fa2763f34c246ca467128b97.tar.xz
lziprecover-92e8b56a5e12ea97fa2763f34c246ca467128b97.zip
Merging upstream version 1.17.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
Diffstat (limited to '')
-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 );