about summary refs log tree commit diff
path: root/time/sys
diff options
context:
space:
mode:
authorTAMUKI Shoichi <tamuki@linet.gr.jp>2019-04-02 16:37:03 +0900
committerTAMUKI Shoichi <tamuki@linet.gr.jp>2019-04-02 16:37:03 +0900
commit2f1d61552d429c4e1cbcec115f3cc3dcaf91400d (patch)
treeaa7b397ab3612822e64c453c58f1336bbb83c85f /time/sys
parent2c7e704b7e590e9895155529f1480e2cdea5424f (diff)
downloadglibc-2f1d61552d429c4e1cbcec115f3cc3dcaf91400d.tar.gz
glibc-2f1d61552d429c4e1cbcec115f3cc3dcaf91400d.tar.xz
glibc-2f1d61552d429c4e1cbcec115f3cc3dcaf91400d.zip
time/tst-strftime2.c: Make the file easier to maintain
Express the years as full Gregorian years (e.g., 1988 instead of 88)
and months with natural numbers (1-12 rather than 0-11).

Compare actual dates rather than indexes when selecting the era name.

Declare the local variable era as a string character pointer rather
than an array of chars where the actual string is copied which might
lead to potential buffer overflows in future.

Co-authored-by: Rafal Luzynski <digitalfreak@lingonborough.com>
Reviewed-by: Carlos O'Donell <carlos@redhat.com>

ChangeLog:

	* time/tst-strftime2.c (date_t): Explicitly define the type.
	(dates): Use natural month and year numbers to express a date.
	(is_before): New function to compare dates.
	(mkreftable): Minor improvements to simplify maintenance.
	(do_test): Reflect the changes in dates array.
Diffstat (limited to 'time/sys')
0 files changed, 0 insertions, 0 deletions