summaryrefslogtreecommitdiffstats
path: root/repair.cc
diff options
context:
space:
mode:
authorDaniel Baumann <mail@daniel-baumann.ch>2015-11-07 11:53:09 +0000
committerDaniel Baumann <mail@daniel-baumann.ch>2015-11-07 11:53:09 +0000
commit746479a2d915d02f6f02ec508202afb1face7c2b (patch)
tree1d26867f949791b0e2ba99246aa252f02e693cef /repair.cc
parentAdding debian version 1.18~pre1-1. (diff)
downloadlziprecover-746479a2d915d02f6f02ec508202afb1face7c2b.tar.xz
lziprecover-746479a2d915d02f6f02ec508202afb1face7c2b.zip
Merging upstream version 1.18~pre2.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
Diffstat (limited to 'repair.cc')
-rw-r--r--repair.cc3
1 files changed, 1 insertions, 2 deletions
diff --git a/repair.cc b/repair.cc
index e83b843..e8588e3 100644
--- a/repair.cc
+++ b/repair.cc
@@ -41,10 +41,9 @@ bool gross_damage( const long long msize, const uint8_t * const mbuffer )
enum { maxlen = 6 }; // max number of consecutive identical bytes
long i = File_header::size;
const long end = msize - File_trailer::size - maxlen;
- uint8_t byte;
while( i < end )
{
- byte = mbuffer[i];
+ const uint8_t byte = mbuffer[i];
int len = 0; // does not count the first byte
while( mbuffer[++i] == byte && ++len < maxlen ) {}
if( len >= maxlen ) return true;