summaryrefslogtreecommitdiffstats
path: root/repair.cc
diff options
context:
space:
mode:
Diffstat (limited to 'repair.cc')
-rw-r--r--repair.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/repair.cc b/repair.cc
index ed611e1..54a4d89 100644
--- a/repair.cc
+++ b/repair.cc
@@ -71,8 +71,8 @@ int repair_file( const std::string & input_filename,
if( verbosity >= 1 ) // damaged member found
{
- std::printf( "Repairing member %ld (failure pos = %llu)\n",
- i + 1, mpos + failure_pos );
+ std::printf( "Repairing member %ld of %ld (failure pos = %llu)\n",
+ i + 1, (long)file_index.members(), mpos + failure_pos );
std::fflush( stdout );
}
uint8_t * const mbuffer = read_member( infd, mpos, msize );
@@ -80,7 +80,7 @@ int repair_file( const std::string & input_filename,
cleanup_and_fail( output_filename, outfd, 1 );
long pos = failure_pos;
bool done = false;
- while( pos >= File_header::size && pos > failure_pos - 20000 && !done )
+ while( pos >= File_header::size && pos > failure_pos - 40000 && !done )
{
const long min_pos = std::max( (long)File_header::size, pos - 1000 );
const LZ_mtester * master = prepare_master( mbuffer, msize, min_pos - 16 );
@@ -118,7 +118,7 @@ int repair_file( const std::string & input_filename,
delete master;
}
delete[] mbuffer;
- if( verbosity >= 1 ) std::printf( "\n" );
+ if( verbosity >= 1 ) std::fputs( "\n", stdout );
if( !done )
{
show_error( "Can't repair input file. Error is probably larger than 1 byte." );
@@ -129,7 +129,7 @@ int repair_file( const std::string & input_filename,
if( outfd < 0 )
{
if( verbosity >= 1 )
- std::printf( "Input file has no errors. Recovery is not needed.\n" );
+ std::fputs( "Input file has no errors. Recovery is not needed.\n", stdout );
return 0;
}
if( close( outfd ) != 0 )
@@ -138,6 +138,6 @@ int repair_file( const std::string & input_filename,
cleanup_and_fail( output_filename, -1, 1 );
}
if( verbosity >= 1 )
- std::printf( "Copy of input file repaired successfully.\n" );
+ std::fputs( "Copy of input file repaired successfully.\n", stdout );
return 0;
}