diff options
author | Daniel Baumann <mail@daniel-baumann.ch> | 2015-11-07 11:49:54 +0000 |
---|---|---|
committer | Daniel Baumann <mail@daniel-baumann.ch> | 2015-11-07 11:49:54 +0000 |
commit | ea9b55f6d0c2eb30dffe1a4815d3696d77888b6a (patch) | |
tree | 95976219fe7545aeb60f2f8894742193a9927b4b /repair.cc | |
parent | Adding upstream version 1.16. (diff) | |
download | lziprecover-ea9b55f6d0c2eb30dffe1a4815d3696d77888b6a.tar.xz lziprecover-ea9b55f6d0c2eb30dffe1a4815d3696d77888b6a.zip |
Adding upstream version 1.17~pre1.upstream/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; } |