Zebediah Figura (@zfigura) commented about tools/widl/write_sltg.c:
- struct sltg_block *block;
- int i;
- header.magic = 0x47544c53;
- header.n_file_blocks = sltg->n_file_blocks + 1;
- header.res06 = 9;
- header.size_of_index = sltg->index.size;
- header.first_blk = 1;
- header.uuid = sltg_library_guid;
- header.res1c = 0x00000044;
- header.res20 = 0xffff0000;
- put_data(&header, sizeof(header));
- block = sltg->blocks;
- for (i = 0; i < sltg->n_file_blocks - 1; i++)
Why minus one?
Moreover, why are we storing the blocks in a hand-rolled linked list, but also keeping a count?