- extract_size = min(wim_resource_size(old_lte), size);
- ret = extract_wim_resource_to_fd(old_lte, fd, extract_size);
+ struct filedes wimlib_fd;
+ filedes_init(&wimlib_fd, fd);
+ extract_size = min(old_lte->size, size);
+ ret = extract_stream_to_fd(old_lte, &wimlib_fd, extract_size);