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:
Soren Sandmann
2006-08-21 04:12:12 +00:00
committed by Søren Sandmann Pedersen
parent 66a28bd501
commit 858d1fab58
2 changed files with 9 additions and 2 deletions

View File

@ -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.

View File

@ -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