microtar
microtar copied to clipboard
Added cmake support and replaced unsafe string functions with safe ones
I modified the library to make it fit for my use and I thought I share it here.
The name and linkname fields in the mtar_header_t struct are both 100 bytes long as mandated by the tar format. The tar format does allow longer names but this seems not supported by this library. Filename size is not checked by the library resulting in corrupted archives if a longer name is specified. I changed the behaviour to printing an error message and calling abort() if a name longer than 100 characters (including null terminator) is specified.
While I was at it I also changed all other string functions that are considered unsafe to their safe alternatives.
Considering the project activity was about 6 or 7 years ago, and since then no PRs are merged, I think you should generally avoid the hassle of creating PRs on this repository. Instead, you may wanna apply (your changes) in your local tree (project).