]> git.ipfire.org Git - thirdparty/gnulib.git/commit
fprintftime: sbyte_count_t to fix some overflows
authorPaul Eggert <eggert@cs.ucla.edu>
Fri, 31 Oct 2025 00:04:48 +0000 (18:04 -0600)
committerPaul Eggert <eggert@cs.ucla.edu>
Fri, 31 Oct 2025 05:54:50 +0000 (23:54 -0600)
commit2bf00710feaf1fcfa486dc5d95de8d7c2306bf40
tree6cf7250c3cf4614e263ada6627c703b55ce4d0b7
parent0ea13f65f029ff98d6aa7576883c2de961a1ebb2
fprintftime: sbyte_count_t to fix some overflows

* lib/strftime.c: Include <stdint.h>, for PTRDIFF_MAX.
(byte_count_t): Now a typedef instead of a macro.
(sbyte_count_t): New typedef.
(SBYTE_COUNT_MAX): New macro.
(memset_byte, width_add, __strftime_internal):
(fwrite_lowcase, fwrite_uppcase) [FPRINTFTIME]:
Avoid overflow issues with fprintftime by using byte_count_t
or sbyte_count_t instead of size_t or int.
* modules/nstrftime: Depend on stdint-h.
ChangeLog
lib/strftime.c
modules/nstrftime