Code Duplication    Length = 5-5 lines in 2 locations

class/pcltar.lib.php 2 locations

@@ 3373-3377 (lines=5) @@
3370
        // ----- Calculate the checksum
3371
        $v_checksum = 0;
3372
        // ..... First part of the header
3373
        for ($i = 0; $i < 148; ++$i) {
3374
            $v_checksum += ord(substr($v_binary_data, $i, 1));
3375
        }
3376
        // ..... Ignore the checksum value and replace it by ' ' (space)
3377
        for ($i = 148; $i < 156; ++$i) {
3378
            $v_checksum += ord(' ');
3379
        }
3380
        // ..... Last part of the header
@@ 3381-3385 (lines=5) @@
3378
            $v_checksum += ord(' ');
3379
        }
3380
        // ..... Last part of the header
3381
        for ($i = 156; $i < 512; ++$i) {
3382
            $v_checksum += ord(substr($v_binary_data, $i, 1));
3383
        }
3384
        TrFctMessage(__FILE__, __LINE__, 3, "Calculated checksum : $v_checksum");
3385
3386
        // ----- Extract the values
3387
        TrFctMessage(__FILE__, __LINE__, 2, "Header : '$v_binary_data'");
3388
        $v_data = unpack('a100filename/a8mode/a8uid/a8gid/a12size/a12mtime/a8checksum/a1typeflag/a100link/a6magic/a2version/a32uname/a32gname/a8devmajor/a8devminor', $v_binary_data);