summaryrefslogtreecommitdiffstats
path: root/repair.cc
diff options
context:
space:
mode:
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;