int main (int argc, char **argv) {
struct xz_buf b = { 0 };
- struct xz_dec *s;
enum xz_ret ret;
int i;
FILE *ifp, *ofp;
+ struct xz_dec *s;
const char *ipath;
char *opath = 0, *p;
xz_crc32_init ();
xz_crc64_init ();
- if (!(s = xz_dec_init (XZ_DYNALLOC, (uint32_t) -1))) {
- return -1;
- }
-
b.out_size = XZ_IOBUF_SIZE;
if (!(b.out = malloc (b.out_size))) {
for (i = 0; i < state->nb_files; i++) {
+ if (!(s = xz_dec_init (XZ_DYNALLOC, (uint32_t) -1))) {
+ continue;
+ }
+
b.out_pos = 0;
b.in_pos = 0;
}
+ xz_dec_end (s);
+
fclose (ifp);
fclose (ofp);
}
- xz_dec_end (s);
free (b.in);
-
- return (get_error_count () ? EXIT_FAILURE : EXIT_SUCCESS);
+ return (get_error_count () ? EXIT_FAILURE : EXIT_SUCCESS);
}