summaryrefslogtreecommitdiffstats
path: root/main.cc
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--main.cc12
1 files changed, 7 insertions, 5 deletions
diff --git a/main.cc b/main.cc
index 0b7a88a..df55c79 100644
--- a/main.cc
+++ b/main.cc
@@ -145,8 +145,9 @@ void show_header( const File_header & header )
for( int i = 0; i < 8 && ( num > 9999 || ( exact && num >= factor ) ); ++i )
{ num /= factor; if( num % factor != 0 ) exact = false;
p = prefix[i]; np = ""; }
- std::fprintf( stderr, "version %d, dictionary size %s%4u %sB. ",
- header.version(), np, num, p );
+ if( verbosity >= 4 )
+ std::fprintf( stderr, "version %d, ", header.version() );
+ std::fprintf( stderr, "dictionary size %s%4u %sB. ", np, num, p );
}
namespace {
@@ -359,7 +360,6 @@ void show_trailing_garbage( const uint8_t * const data, const int size,
int decompress( const int infd, const Pretty_print & pp, const bool testing )
{
- const char * const ok_msg = ( testing ? "ok\n" : "done\n" );
int retval = 0;
try {
@@ -418,7 +418,8 @@ int decompress( const int infd, const Pretty_print & pp, const bool testing )
}
retval = 2; break;
}
- if( verbosity >= 2 ) { std::fprintf( stderr, ok_msg ); pp.reset(); }
+ if( verbosity >= 2 )
+ { std::fprintf( stderr, testing ? "ok\n" : "done\n" ); pp.reset(); }
}
}
catch( std::bad_alloc )
@@ -427,7 +428,8 @@ int decompress( const int infd, const Pretty_print & pp, const bool testing )
retval = 1;
}
catch( Error e ) { pp(); show_error( e.msg, errno ); retval = 1; }
- if( verbosity == 1 && retval == 0 ) std::fprintf( stderr, ok_msg );
+ if( verbosity == 1 && retval == 0 )
+ std::fprintf( stderr, testing ? "ok\n" : "done\n" );
return retval;
}