X-Git-Url: https://wimlib.net/git/?p=wimlib;a=blobdiff_plain;f=src%2Fresource.c;h=84d4441bb26add7738f25cee44b3af044e97e145;hp=29bfcd7fd0a962fb7c29d6f7621251876bc43e5d;hb=c9482ee98e12fa3f1073e4fc3c56f5eef3c40f32;hpb=7bbd03a7f450e59ebd7481cd1af0639131630f42 diff --git a/src/resource.c b/src/resource.c index 29bfcd7f..84d4441b 100644 --- a/src/resource.c +++ b/src/resource.c @@ -460,7 +460,7 @@ read_partial_wim_resource(const struct wim_lookup_table_entry *lte, lte->resource_entry.size, lte->resource_entry.original_size, lte->resource_entry.offset, - wimlib_get_compression_type(wim), + wim->compression_type, size, offset, cb, @@ -691,13 +691,13 @@ extract_wim_resource(const struct wim_lookup_table_entry *lte, u8 hash[SHA1_HASH_SIZE]; sha1_final(hash, &ctx.sha_ctx); if (!hashes_equal(hash, lte->hash)) { - #ifdef ENABLE_ERROR_MESSAGES - ERROR("Invalid SHA1 message digest " - "on the following WIM resource:"); - print_lookup_table_entry(lte, stderr); - if (lte->resource_location == RESOURCE_IN_WIM) - ERROR("The WIM file appears to be corrupt!"); - #endif + if (wimlib_print_errors) { + ERROR("Invalid SHA1 message digest " + "on the following WIM resource:"); + print_lookup_table_entry(lte, stderr); + if (lte->resource_location == RESOURCE_IN_WIM) + ERROR("The WIM file appears to be corrupt!"); + } ret = WIMLIB_ERR_INVALID_RESOURCE_HASH; } }