]> git.ipfire.org Git - thirdparty/coreutils.git/commit
fold: fix write error checks with invalid multi-byte input
authorPádraig Brady <P@draigBrady.com>
Tue, 16 Sep 2025 15:45:02 +0000 (16:45 +0100)
committerPádraig Brady <P@draigBrady.com>
Tue, 16 Sep 2025 17:41:51 +0000 (18:41 +0100)
commitc95c7ee76ff4480125a15b8e53945b60e58de400
treefc12ae53976e9fdf22d9c17abee8216f93de7d9a
parent10459ca7ed15456a6dbfebc7d718c8d713fbfe70
fold: fix write error checks with invalid multi-byte input

* src/fold.c (write_out): A new helper to check all writes.
(fold-file): Use write_out() for all writes.
* tests/fold/fold-zero-width.sh: Adjust to writing more
data in various patterns, rather than two buffers of NULs.
This is a more robust memory bound check, and the '\303' case
tests this particular logic change.
* NEWS: fold now exits immediately, not just promptly.
NEWS
src/fold.c
tests/fold/fold-zero-width.sh