wim.c: Cleanup
[wimlib] / src / write.c
index 36a431a..c63f0f7 100644 (file)
@@ -2668,8 +2668,10 @@ write_wim_part(WIMStruct *wim,
        wim->hdr.total_parts = total_parts;
 
        /* Set compression type if different.  */
-       if (wim->compression_type != wim->out_compression_type)
-               wim->hdr.flags = get_wim_hdr_cflags(wim->out_compression_type);
+       if (wim->compression_type != wim->out_compression_type) {
+               ret = set_wim_hdr_cflags(wim->out_compression_type, &wim->hdr);
+               wimlib_assert(ret == 0);
+       }
 
        /* Set chunk size if different.  */
        wim->hdr.chunk_size = wim->out_chunk_size;