From: Eric Biggers Date: Sun, 3 Mar 2013 20:23:09 +0000 (-0600) Subject: read_lookup_table(): guard printing by ENABLE_ERROR_MESSAGES X-Git-Tag: v1.2.6~24 X-Git-Url: https://wimlib.net/git/?p=wimlib;a=commitdiff_plain;h=6c71ffe3bf00c347a33e7ce31458664017287abc;hp=71ac0d27d857d6de96d231fa41f4008f5654a998 read_lookup_table(): guard printing by ENABLE_ERROR_MESSAGES --- diff --git a/src/lookup_table.c b/src/lookup_table.c index 077fff97..7e1155b1 100644 --- a/src/lookup_table.c +++ b/src/lookup_table.c @@ -344,12 +344,14 @@ int read_lookup_table(WIMStruct *w) && !((duplicate_entry->resource_entry.flags & WIM_RESHDR_FLAG_METADATA) && cur_entry->resource_entry.flags & WIM_RESHDR_FLAG_METADATA)) { + #ifdef ENABLE_ERROR_MESSAGES ERROR("The WIM lookup table contains two entries with the " "same SHA1 message digest!"); ERROR("The first entry is:"); print_lookup_table_entry(duplicate_entry); ERROR("The second entry is:"); print_lookup_table_entry(cur_entry); + #endif ret = WIMLIB_ERR_INVALID_LOOKUP_TABLE_ENTRY; goto out_free_cur_entry; } @@ -358,18 +360,22 @@ int read_lookup_table(WIMStruct *w) && (cur_entry->resource_entry.size != cur_entry->resource_entry.original_size)) { + #ifdef ENABLE_ERROR_MESSAGES ERROR("Found uncompressed resource with original size " "not the same as compressed size"); ERROR("The lookup table entry for the resource is as follows:"); print_lookup_table_entry(cur_entry); + #endif ret = WIMLIB_ERR_INVALID_LOOKUP_TABLE_ENTRY; goto out_free_cur_entry; } if ((cur_entry->resource_entry.flags & WIM_RESHDR_FLAG_METADATA) && cur_entry->refcnt != 1) { + #ifdef ENABLE_ERROR_MESSAGES ERROR("Found metadata resource with refcnt != 1:"); print_lookup_table_entry(cur_entry); + #endif ret = WIMLIB_ERR_INVALID_LOOKUP_TABLE_ENTRY; goto out_free_cur_entry; }