|
|
*/ | */ |
static void decompress_file(struct rzip_control *control) | static void decompress_file(struct rzip_control *control) |
{ | { |
int fd_in, fd_out = -1, fd_hist = -1; |
int fd_in, fd_out = -1, fd_hist = -1, len; |
off_t expected_size; | off_t expected_size; |
| |
if (control->outname) { | if (control->outname) { |
|
|
fatal("%s: unknown suffix\n", control->infile); | fatal("%s: unknown suffix\n", control->infile); |
} | } |
| |
control->outfile = strndup(control->infile, |
len = strlen(control->infile) - strlen(control->suffix); |
strlen(control->infile) - |
control->outfile = malloc(len + 1); |
strlen(control->suffix)); |
control->outfile[len] = '\0'; |
|
strncpy(control->outfile, control->infile, len); |
} | } |
| |
fd_in = open(control->infile,O_RDONLY); | fd_in = open(control->infile,O_RDONLY); |