]> wimlib.net Git - wimlib/blobdiff - src/metadata_resource.c
imagex.c: Fix string literal used in oom path only
[wimlib] / src / metadata_resource.c
index e4eb78ab6417e8613b6bd26a98ed9a014f628df3..255903699bc0f1cc7f8d9e7abe42c9196ac3ee96 100644 (file)
  *     WIMLIB_ERR_SUCCESS (0)
  *     WIMLIB_ERR_INVALID_METADATA_RESOURCE
  *     WIMLIB_ERR_NOMEM
+ *     WIMLIB_ERR_READ
+ *     WIMLIB_ERR_UNEXPECTED_END_OF_FILE
+ *     WIMLIB_ERR_DECOMPRESSION
  */
 int
 read_metadata_resource(WIMStruct *wim, struct wim_image_metadata *imd)
 {
-       u8 *buf;
+       void *buf;
        int ret;
        struct wim_dentry *root;
        const struct wim_lookup_table_entry *metadata_lte;
@@ -87,7 +90,7 @@ read_metadata_resource(WIMStruct *wim, struct wim_image_metadata *imd)
        }
 
        /* Read the metadata resource into memory.  (It may be compressed.) */
-       ret = read_full_resource_into_alloc_buf(metadata_lte, (void**)&buf);
+       ret = read_full_resource_into_alloc_buf(metadata_lte, &buf);
        if (ret)
                return ret;
 
@@ -243,7 +246,7 @@ prepare_metadata_resource(WIMStruct *wim, int image,
         */
        recalculate_security_data_length(sd);
        subdir_offset = (((u64)sd->total_length + 7) & ~7) +
-                       dentry_correct_total_length(root) + 8;
+                       dentry_out_total_length(root) + 8;
 
        /* Calculate the subdirectory offsets for the entire dentry tree.  */
        calculate_subdir_offsets(root, &subdir_offset);