if (ret != 0)
break;
sha1_update(&ctx, buf, to_read);
- if (full_write(fd, buf, to_read) < 0) {
+ if (full_write(fd, buf, to_read) < to_read) {
ERROR_WITH_ERRNO("Error extracting WIM resource");
return WIMLIB_ERR_WRITE;
}
if (ret != 0)
goto out;
- /* It's very likely the SHA1 message digest of the metadata resource, so
- * re-insert the lookup table entry into the lookup table. */
+ /* It's very likely the SHA1 message digest of the metadata resource
+ * changed, so re-insert the lookup table entry into the lookup table.
+ * */
lookup_table_unlink(w->lookup_table, lte);
lookup_table_insert(w->lookup_table, lte);