]> git.ipfire.org Git - thirdparty/coreutils.git/commit
tail: prefer signed types to size_t, blksize_t
authorPaul Eggert <eggert@cs.ucla.edu>
Wed, 30 Jul 2025 22:11:31 +0000 (15:11 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 4 Aug 2025 02:48:05 +0000 (19:48 -0700)
commit382044766789d961fd8124dd7f8a0a06058da20a
treec8cba37aea00bc9bfdabb6005df25305e40f2849
parent0625370b7ae4f925a3d93847224c56cb5c6c9f64
tail: prefer signed types to size_t, blksize_t

* src/tail.c (struct File_spec, xwrite_stdout, file_lines)
(pipe_lines, pipe_bytes, start_bytes, any_live_files)
(tail_forever, any_remote_file, any_non_remote_file)
(any_symlinks, any_non_regular_fifo, tailable_stdin)
(tail_forever_inotify, ignore_fifo_and_pipe, main):
Prefer a signed type to size_t, if possible.
Ordinarily this is idx_t, but use int when the value
must fit in int anyway.
(file_lines): Similarly for blksize_t, which had no business
being here anyway.
(main): Check for overflow in the oddball case where ptrdiff_t is
narrower than int.
src/tail.c