/* in update_short_entry, replace this: */ *sizeptr = htole32(size); /* by this */ if(size != -1) *sizeptr = htole32(size); void fat_set_volume_id(struct fat_file *file) { update_short_entry(file, -1, FAT_ATTR_VOLUME_ID | FAT_ATTR_DIRECTORY) }