}
swap_file_header(&header, fileHeader);
- if (header.offset < sizeof(const struct cbfs_cachenode *) ||
- header.offset > header.len) {
+ if (header.offset < sizeof(struct cbfs_fileheader) ||
+ header.offset > header.len) {
file_cbfs_result = CBFS_BAD_FILE;
return -1;
}
newNode->type = header.type;
newNode->data = start + header.offset;
newNode->data_length = header.len;
- name_len = header.offset - sizeof(struct cbfs_cachenode *);
+ name_len = header.offset - sizeof(struct cbfs_fileheader);
newNode->name = (char *)fileHeader +
- sizeof(struct cbfs_cachenode *);
+ sizeof(struct cbfs_fileheader);
newNode->name_length = name_len;
newNode->checksum = header.checksum;