diff options
author | Daniel Baumann <mail@daniel-baumann.ch> | 2015-11-07 11:50:02 +0000 |
---|---|---|
committer | Daniel Baumann <mail@daniel-baumann.ch> | 2015-11-07 11:50:02 +0000 |
commit | 018cead199f4ee24f0286cbd033355eae7f8fdae (patch) | |
tree | f0a935bac9c716aa3eed352755efa62e1b2b8206 /repair.cc | |
parent | Adding debian version 1.16-2. (diff) | |
download | lziprecover-018cead199f4ee24f0286cbd033355eae7f8fdae.tar.xz lziprecover-018cead199f4ee24f0286cbd033355eae7f8fdae.zip |
Merging upstream version 1.17~pre1.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
Diffstat (limited to '')
-rw-r--r-- | repair.cc | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -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; } |