690
704
if strncmp(c_bytes, 'type=leaf\n', 10):
691
705
raise ValueError("bytes did not start with 'type=leaf\\n': %r"
702
709
# Now allocate the memory for these items, and go to town
705
710
self.records = <gc_chk_sha1_record*>PyMem_Malloc(num_records *
706
711
(sizeof(unsigned short) + sizeof(gc_chk_sha1_record)))
707
712
self.num_records = num_records
709
713
cur_record = self.records
711
715
while c_cur != NULL and c_cur < c_end and entry < num_records:
712
716
c_cur = self._parse_one_entry(c_cur, c_end, cur_record)
715
719
if (entry != self.num_records
717
721
or cur_record != self.records + self.num_records):