Skip to content
Commit 2f1d6155 authored by TAMUKI Shoichi's avatar TAMUKI Shoichi
Browse files

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: default avatarRafal Luzynski <digitalfreak@lingonborough.com>
Reviewed-by: default avatarCarlos 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.
parent 2c7e704b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment