The random error can be triggered with:
$ LC_ALL=C TZ=UTC0 date -d @0 '+%9223372036854775808Y'
date: fprintftime error: No such file or directory
With the fix it gives:
date: fprintftime error: Numerical result out of range
This issue was introduced in commit 42ea6679 (Nov 2025).
* lib/strftime.c (__strftime_internal): Set errno=ERANGE
upon width overflow.
---
lib/strftime.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/lib/strftime.c b/lib/strftime.c
index 76c7e57b70..94a771155f 100644
--- a/lib/strftime.c
+++ b/lib/strftime.c
@@ -1441,7 +1441,10 @@ __strftime_internal (STREAM_OR_CHAR_T *s, STRFTIME_ARG
(size_t maxsize)
{
if (ckd_mul (&width, width, 10)
|| ckd_add (&width, width, *f - L_('0')))
- return FAILURE;
+ {
+ errno = ERANGE;
+ return FAILURE;
+ }
++f;
}
while (ISDIGIT (*f));
--
2.56.0