Compare commits

..

No commits in common. "main" and "1.7.5" have entirely different histories.
main ... 1.7.5

3 changed files with 7 additions and 14 deletions

View File

@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.8..3.22) cmake_minimum_required(VERSION 3.8..3.22)
project(minitar LANGUAGES C VERSION 1.7.6) project(minitar LANGUAGES C VERSION 1.7.5)
option(MINITAR_IGNORE_UNSUPPORTED_TYPES "Skip past entries that have unsupported types instead of panicking (deprecated)" OFF) option(MINITAR_IGNORE_UNSUPPORTED_TYPES "Skip past entries that have unsupported types instead of panicking (deprecated)" OFF)

View File

@ -43,7 +43,7 @@ See [examples](examples/) for more examples using minitar.
## Project structure ## Project structure
The user-facing API (functions defined in `minitar.h` and documented in [API.md](docs/API.md)) is implemented in `src/tar.c`. Utility and internally-used functions live in `src/util.c`. The user-facing API (functions defined in `minitar.h` and documented in this README) is implemented in `src/tar.c`. Utility and internally-used functions live in `src/util.c`.
## Documentation ## Documentation
@ -75,4 +75,4 @@ pub extern "C" fn minitar_handle_panic(message: *const u8) -> !
## License ## License
`minitar` is free and open-source software under the [BSD-2-Clause](LICENSE) license. `minitar` is free and open-source software under the [BSD-2-Clause](LICENSE) license.

View File

@ -47,7 +47,6 @@ int main(int argc, char** argv)
if (!buf) if (!buf)
{ {
perror("malloc"); perror("malloc");
fclose(fp);
exit_status = 1; exit_status = 1;
break; break;
} }
@ -55,7 +54,8 @@ int main(int argc, char** argv)
if (ferror(fp)) if (ferror(fp))
{ {
perror("fread"); perror("fread");
goto err; exit_status = 1;
break;
} }
struct stat st; struct stat st;
@ -63,7 +63,8 @@ int main(int argc, char** argv)
if (rc < 0) if (rc < 0)
{ {
perror("fstat"); perror("fstat");
goto err; exit_status = 1;
break;
} }
struct minitar_entry_metadata metadata; struct minitar_entry_metadata metadata;
@ -77,7 +78,6 @@ int main(int argc, char** argv)
rc = minitar_write_file_entry(&mp, &metadata, buf); rc = minitar_write_file_entry(&mp, &metadata, buf);
free(buf); free(buf);
fclose(fp);
if (rc != 0) if (rc != 0)
{ {
@ -87,13 +87,6 @@ int main(int argc, char** argv)
} }
arg++; arg++;
continue;
err:
free(buf);
fclose(fp);
exit_status = 1;
break;
} }
minitar_close_w(&mp); minitar_close_w(&mp);
return exit_status; return exit_status;