]> git.ipfire.org Git - thirdparty/util-linux.git/commit
textutils: introduce and use fgetwc_or_err
authorThomas Weißschuh <thomas@t-8ch.de>
Sat, 13 Apr 2024 08:34:32 +0000 (10:34 +0200)
committerThomas Weißschuh <thomas@t-8ch.de>
Sat, 13 Apr 2024 11:04:36 +0000 (13:04 +0200)
commit12707a4948c1bcd54859824b26a46f530f0949d0
tree93444d8c9edc9d803b77da6e6e1b8e8982e71480
parentccb3af024cb134acb391a44283dec4ed40c3605b
textutils: introduce and use fgetwc_or_err

A return value of WEOF of fgetwc() can either mean end-of-file or an
error in errno. The error was ignored and interpreted as end-of-file.
Introduce a new helper that aborts on error and use it in text-utils.

This replaces all calls to plain fgetwc().

Closes #2909
Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
13 files changed:
include/Makemodule.am
include/fgetwc_or_err.h [new file with mode: 0644]
tests/expected/colcrt/regressions-crash1
tests/expected/colcrt/regressions-crash1.err [new file with mode: 0644]
tests/expected/colcrt/regressions-crash2
tests/expected/colcrt/regressions-crash2.err [new file with mode: 0644]
tests/expected/colcrt/regressions-hang1
tests/expected/colcrt/regressions-hang1.err [new file with mode: 0644]
tests/ts/colcrt/regressions
text-utils/colcrt.c
text-utils/colrm.c
text-utils/rev.c
text-utils/ul.c