diff options
author | Daniel Baumann <mail@daniel-baumann.ch> | 2015-11-07 11:48:34 +0000 |
---|---|---|
committer | Daniel Baumann <mail@daniel-baumann.ch> | 2015-11-07 11:48:34 +0000 |
commit | f98dd70cd887a8372f0fcf70be5497d0ffafaa35 (patch) | |
tree | 52981173bfc4cdcdabc62606559987127a946776 /file_index.cc | |
parent | Adding upstream version 1.16~rc1. (diff) | |
download | lziprecover-f98dd70cd887a8372f0fcf70be5497d0ffafaa35.tar.xz lziprecover-f98dd70cd887a8372f0fcf70be5497d0ffafaa35.zip |
Adding upstream version 1.16.upstream/1.16
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
Diffstat (limited to 'file_index.cc')
-rw-r--r-- | file_index.cc | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/file_index.cc b/file_index.cc index 0ce83d1..f7e1cd0 100644 --- a/file_index.cc +++ b/file_index.cc @@ -1,5 +1,5 @@ -/* Lziprecover - Data recovery tool for lzip files - Copyright (C) 2009, 2010, 2011, 2012, 2013, 2014 Antonio Diaz Diaz. +/* Lziprecover - Data recovery tool for the lzip format + Copyright (C) 2009-2014 Antonio Diaz Diaz. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -69,7 +69,7 @@ File_index::File_index( const int infd ) : isize( lseek( infd, 0, SEEK_END ) ), retval_( 0 ) { if( isize < 0 ) - { set_errno_error( "Input file is not seekable :" ); return; } + { set_errno_error( "Input file is not seekable: " ); return; } if( isize < min_member_size ) { error_ = "Input file is too short."; retval_ = 2; return; } if( isize > INT64_MAX ) @@ -78,7 +78,7 @@ File_index::File_index( const int infd ) File_header header; if( seek_read( infd, header.data, File_header::size, 0 ) != File_header::size ) - { set_errno_error( "Error reading member header :" ); return; } + { set_errno_error( "Error reading member header: " ); return; } if( !header.verify_magic() ) { error_ = "Bad magic number (file not in lzip format)."; retval_ = 2; return; } @@ -92,7 +92,7 @@ File_index::File_index( const int infd ) File_trailer trailer; if( seek_read( infd, trailer.data, File_trailer::size, pos - File_trailer::size ) != File_trailer::size ) - { set_errno_error( "Error reading member trailer :" ); break; } + { set_errno_error( "Error reading member trailer: " ); break; } const long long member_size = trailer.member_size(); if( member_size < min_member_size || member_size > pos ) { @@ -103,7 +103,7 @@ File_index::File_index( const int infd ) } if( seek_read( infd, header.data, File_header::size, pos - member_size ) != File_header::size ) - { set_errno_error( "Error reading member header :" ); break; } + { set_errno_error( "Error reading member header: " ); break; } if( !header.verify_magic() || !header.verify_version() ) { if( member_vector.empty() ) // maybe trailing garbage @@ -149,7 +149,7 @@ File_index::File_index( const std::vector< int > & infd_vector, : isize( fsize ), retval_( 0 ) { if( isize < 0 ) - { set_errno_error( "Input file is not seekable :" ); return; } + { set_errno_error( "Input file is not seekable: " ); return; } if( isize < min_member_size ) { error_ = "Input file is too short."; retval_ = 2; return; } if( isize > INT64_MAX ) @@ -163,7 +163,7 @@ File_index::File_index( const std::vector< int > & infd_vector, { const int infd = infd_vector[i]; if( seek_read( infd, header.data, File_header::size, 0 ) != File_header::size ) - { set_errno_error( "Error reading member header :" ); return; } + { set_errno_error( "Error reading member header: " ); return; } if( header.verify_magic() && header.verify_version() ) done = true; } if( !done ) @@ -181,7 +181,7 @@ File_index::File_index( const std::vector< int > & infd_vector, const int tfd = infd_vector[it]; if( seek_read( tfd, trailer.data, File_trailer::size, pos - File_trailer::size ) != File_trailer::size ) - { set_errno_error( "Error reading member trailer :" ); goto error; } + { set_errno_error( "Error reading member trailer: " ); goto error; } member_size = trailer.member_size(); if( member_size >= min_member_size && member_size <= pos ) for( int ih = 0; ih < files && !done; ++ih ) @@ -189,7 +189,7 @@ File_index::File_index( const std::vector< int > & infd_vector, const int hfd = infd_vector[ih]; if( seek_read( hfd, header.data, File_header::size, pos - member_size ) != File_header::size ) - { set_errno_error( "Error reading member header :" ); goto error; } + { set_errno_error( "Error reading member header: " ); goto error; } if( header.verify_magic() && header.verify_version() ) done = true; } } |