mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2025-12-31 20:36:25 +00:00
Initialize crc to 0xffffffff and invert it before returning.
2006-08-20 Soren Sandmann <sandmann@redhat.com> * elfparser.c (elf_parser_get_crc32): Initialize crc to 0xffffffff and invert it before returning. * elfparser.h: Declare elf_parser_get_debug_link()
This commit is contained in:
committed by
Søren Sandmann Pedersen
parent
66a28bd501
commit
858d1fab58
@ -1,3 +1,10 @@
|
||||
2006-08-20 Soren Sandmann <sandmann@redhat.com>
|
||||
|
||||
* elfparser.c (elf_parser_get_crc32): Initialize crc to 0xffffffff
|
||||
and invert it before returning.
|
||||
|
||||
* elfparser.h: Declare elf_parser_get_debug_link()
|
||||
|
||||
2006-08-20 Soren Sandmann <sandmann@daimi.au.dk>
|
||||
|
||||
* elfparser.c (elf_parser_get_load_address): Comment out debug spew.
|
||||
|
||||
@ -245,12 +245,12 @@ elf_parser_get_crc32 (ElfParser *parser)
|
||||
data = bin_parser_get_data (parser->parser);
|
||||
length = bin_parser_get_length (parser->parser);
|
||||
|
||||
crc = 0;
|
||||
crc = 0xffffffff;
|
||||
|
||||
for (i = 0; i < length; ++i)
|
||||
crc = crc32_table[(crc ^ data[i]) & 0xff] ^ (crc >> 8);
|
||||
|
||||
return crc & 0xFFFFFFFF;
|
||||
return ~crc & 0xffffffff;
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
Reference in New Issue
Block a user