X-Git-Url: https://wimlib.net/git/?p=wimlib;a=blobdiff_plain;f=src%2Fjoin.c;h=f41cf047bc80ceb79f2bbd5450f8faa6f93d134a;hp=bf84efa503d96e7364725d423808d1986484c2be;hb=5c85ddd0c9dc90b43603317dcfb809bfc4d192bc;hpb=5a172ad88105a66fe903aeacc0f576d7ff2211cd diff --git a/src/join.c b/src/join.c index bf84efa5..f41cf047 100644 --- a/src/join.c +++ b/src/join.c @@ -53,6 +53,23 @@ static int cmp_swms_by_part_number(const void *swm1, const void *swm2) return (int)partno_1 - (int)partno_2; } +/* + * Sanity checks to make sure a set of WIMs correctly correspond to a spanned + * set. + * + * @w: + * Part 1 of the set. + * + * @additional_swms: + * All parts of the set other than part 1. + * + * @num_additional_swms: + * Number of WIMStructs in @additional_swms. Or, the total number of parts + * in the set minus 1. + * + * @return: + * 0 on success; WIMLIB_ERR_SPLIT_INVALID if the set is not valid. + */ int verify_swm_set(WIMStruct *w, WIMStruct **additional_swms, unsigned num_additional_swms) { @@ -63,8 +80,8 @@ int verify_swm_set(WIMStruct *w, WIMStruct **additional_swms, if (total_parts != num_additional_swms + 1) { ERROR("`%s' says there are %u parts in the spanned set, " "but %s%u part%s provided", - w->filename, w->hdr.total_parts, - (num_additional_swms + 1 < w->hdr.total_parts) ? "only " : "", + w->filename, total_parts, + (num_additional_swms + 1 < total_parts) ? "only " : "", num_additional_swms + 1, (num_additional_swms) ? "s were" : " was"); return WIMLIB_ERR_SPLIT_INVALID;