u64
wim_info_get_total_bytes(const struct wim_info *info)
{
- if (!info)
+ if (info)
+ return info->total_bytes;
+ else
return 0;
- return info->total_bytes;
}
u64
wim_info_get_image_hard_link_bytes(const struct wim_info *info, int image)
{
- return info->images[image - 1].hard_link_bytes;
+ if (info)
+ return info->images[image - 1].hard_link_bytes;
+ else
+ return 0;
}
u64
wim_info_get_image_total_bytes(const struct wim_info *info, int image)
{
- return info->images[image - 1].total_bytes;
+ if (info)
+ return info->images[image - 1].total_bytes;
+ else
+ return 0;
}
unsigned
wim_info_get_num_images(const struct wim_info *info)
{
- return info->num_images;
+ if (info)
+ return info->num_images;
+ else
+ return 0;
}
/* Returns a statically allocated string that is a string representation of the
int
read_wim_xml_data(WIMStruct *wim)
{
+ void *buf;
u8 *xml_data;
xmlDoc *doc;
xmlNode *root;
DEBUG("Reading XML data: %"PRIu64" bytes at offset %"PRIu64"",
(u64)res_entry->size, res_entry->offset);
- ret = res_entry_to_data(res_entry, wim, (void**)&xml_data);
+ ret = res_entry_to_data(res_entry, wim, &buf);
if (ret)
goto out;
+ xml_data = buf;
doc = xmlReadMemory((const char *)xml_data, res_entry->original_size,
NULL, "UTF-16LE", 0);