]> git.ipfire.org Git - thirdparty/libarchive.git/commit
tar: Make safe_fprintf more platform independent 2609/head
authorTobias Stoeckmann <tobias@stoeckmann.org>
Fri, 16 May 2025 22:01:53 +0000 (00:01 +0200)
committerTobias Stoeckmann <tobias@stoeckmann.org>
Fri, 16 May 2025 22:23:01 +0000 (00:23 +0200)
commitc2d06848ea34814fc6b227ce97015474c7b71d10
tree0af2ec1721c5a6308b0e97b72d0e191f7a5a919f
parentf3f2aaf0acd27d27ac1c9baa5af2667a13af0571
tar: Make safe_fprintf more platform independent

If vsnprintf fails with errno EOVERFLOW, the results are very platform
dependent but never useful. The implementation in glibc fills bytes with
blanks, FreeBSD fills them with zeros, OpenBSD and Windows set first
byte to '\0'.

Just stop processing and don't print anything, which makes it follow
the OpenBSD and Windows approach.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
tar/util.c