unsigned long nextoffset, truncoffset;
struct cbfs_file *newfile = NULL;
- while (offset < rom->fssize) {
+ while ((offset + size) < rom->fssize) {
c = (struct cbfs_file *)ROM_PTR(rom, offset);
c = rom_alloc(rom, name, size, type);
if (c == NULL) {
- ERROR("There is no more room in this ROM\n");
+ ERROR("There is not enough room in this ROM\n");
return -1;
}