struct cbfs_file *c = NULL;
unsigned long nextoffset, truncoffset;
struct cbfs_file *newfile = NULL;
- unsigned int csize;
while (offset < rom->fssize) {
c->len = htonl(size);
- csize = headersize(name);
-
strcpy(c->magic, COMPONENT_MAGIC);
- c->offset = htonl(csize);
+ c->offset = htonl(headersize(name));
c->type = htonl(type);
int rom_extract(struct rom *rom, const char *name, void** buf, int *size )
{
struct cbfs_file *c = rom_find_by_name(rom, name);
- unsigned int csize;
if (c == NULL) {
ERROR("Component %s does not exist\n", name);
}
*size = ntohl(c->len);
-
- csize = headersize(name);
- *buf = ((unsigned char *)c) + csize;
+ *buf = ((unsigned char *)c) + headersize(name);
return 0;
}