Code Duplication    Length = 5-5 lines in 2 locations

class/pcltar.lib.php 2 locations

@@ 3396-3400 (lines=5) @@
3393
        // ----- Calculate the checksum
3394
        $v_checksum = 0;
3395
        // ..... First part of the header
3396
        for ($i = 0; $i < 148; ++$i) {
3397
            $v_checksum += ord(substr($v_binary_data, $i, 1));
3398
        }
3399
        // ..... Ignore the checksum value and replace it by ' ' (space)
3400
        for ($i = 148; $i < 156; ++$i) {
3401
            $v_checksum += ord(' ');
3402
        }
3403
        // ..... Last part of the header
@@ 3404-3408 (lines=5) @@
3401
            $v_checksum += ord(' ');
3402
        }
3403
        // ..... Last part of the header
3404
        for ($i = 156; $i < 512; ++$i) {
3405
            $v_checksum += ord(substr($v_binary_data, $i, 1));
3406
        }
3407
        TrFctMessage(__FILE__, __LINE__, 3, "Calculated checksum : $v_checksum");
3408
3409
        // ----- Extract the values
3410
        TrFctMessage(__FILE__, __LINE__, 2, "Header : '$v_binary_data'");
3411
        $v_data = unpack('a100filename/a8mode/a8uid/a8gid/a12size/a12mtime/a8checksum/a1typeflag/a100link/a6magic/a2version/a32uname/a32gname/a8devmajor/a8devminor', $v_binary_data);