X-Git-Url: https://wimlib.net/git/?a=blobdiff_plain;f=src%2Fjoin.c;h=8a0abe5d663e912c0a28d6058c820cd368eebedc;hb=66886005209df72f53d0921cb32be6b13500e287;hp=622919e976b5ce97d8ae39273f6b4a81da9134c2;hpb=e176e9731e696562bab8de7b9bd34c019deef3e8;p=wimlib diff --git a/src/join.c b/src/join.c index 622919e9..8a0abe5d 100644 --- a/src/join.c +++ b/src/join.c @@ -169,7 +169,8 @@ wimlib_join(const tchar * const *swm_names, return WIMLIB_ERR_INVALID_PARAM; num_additional_swms = num_swms - 1; - additional_swms = CALLOC(num_additional_swms, sizeof(additional_swms[0])); + additional_swms = CALLOC((num_additional_swms + 1), + sizeof(additional_swms[0])); if (!additional_swms) return WIMLIB_ERR_NOMEM; @@ -188,6 +189,7 @@ wimlib_join(const tchar * const *swm_names, } if (!swm0) { + ERROR("Part 1 of the split WIM was not specified!"); ret = WIMLIB_ERR_SPLIT_INVALID; goto out_free_swms; } @@ -201,6 +203,8 @@ wimlib_join(const tchar * const *swm_names, if (ret) goto out_free_swms; + swm0->guid_set_explicitly = 1; + /* It is reasonably safe to provide, WIMLIB_WRITE_FLAG_STREAMS_OK, as we * have verified that the specified split WIM parts form a spanned set. */ @@ -208,7 +212,7 @@ wimlib_join(const tchar * const *swm_names, wim_write_flags | WIMLIB_WRITE_FLAG_STREAMS_OK, 1, progress_func); out_free_swms: - for (i = 0; i < num_additional_swms; i++) + for (i = 0; i < num_additional_swms + 1; i++) wimlib_free(additional_swms[i]); FREE(additional_swms); wimlib_free(swm0);