]> git.ipfire.org Git - thirdparty/coreutils.git/commit
pr: improve nstrftime failure check
authorPaul Eggert <eggert@cs.ucla.edu>
Sat, 1 Nov 2025 23:42:59 +0000 (17:42 -0600)
committerPaul Eggert <eggert@cs.ucla.edu>
Sun, 2 Nov 2025 00:00:32 +0000 (18:00 -0600)
commit70bb8fa34f52b961ceaf63f61645e06d9f14446e
tree91d9e920cfbc3e34a27fc9a94aee2cfab21427d6
parentb427c185f266f5ab549e311a3c26a179d51f7d35
pr: improve nstrftime failure check

* src/pr.c (init_header): Do not report an nstrftime EOVERFLOW
error as memory exhaustion.  Instead, output the time as an
integer.  Also, work even if nstrftime (nullptr, SIZE_MAX, ...)
would return PTRDIFF_MAX which means adding 1 would overflow..
src/pr.c