Changeset b9b1bde in thomson


Ignore:
Timestamp:
Feb 17, 2013, 9:38:35 PM (11 years ago)
Author:
Adrien Destugues <pulkomandy@…>
Branches:
main
Children:
732c820
Parents:
0c42eb7
Message:

Fix checksum computations

git-svn-id: svn://localhost/thomson@36 85ae3b6b-dc8f-4344-a89d-598714f2e4e5

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tools/f2k5.cpp

    r0c42eb7 rb9b1bde  
    4040                head[l++] = 0;
    4141                head[l] = 0;
     42
    4243                for(int i = 2; i < l; i++)
    4344                        head[l] += head[i];
    44                 head[l++] ^= 255;
     45                head[l] = -head[l];
     46                l++;
    4547                fwrite(head, 1, 17, out);
    4648
     
    5759                        fwrite(head, 1, 2, out);
    5860                        fwrite(buf, 1, l, out);
     61
     62                        head[0] = 0;
    5963                        while(l > 0)
    60                                 head[0] += buf[--l];
    61                         head[0] ^= 0xFF;
     64                                head[0] -= buf[--l];
    6265                        fwrite(head, 1, 1, out);
    6366                }
Note: See TracChangeset for help on using the changeset viewer.