cvs commit: src/bin/ls extern.h ls.c print.c util.c src/bin/pax ar_io.c ar_subs.c cache.c cpio.c extern.h gen_subs.c getoldopt.c options.c pat_rep.c pax.c pax.h src/bin/ps fmt.c src/bin/rcp rcp.c

Dag-Erling Smorgrav des at ofug.org
Sat May 3 15:29:32 PDT 2003


Giorgos Keramidas <keramida at ceid.upatras.gr> writes:
>  	} else
> -		(void)strftime(buf, sizeof(buf), "%e%b%y", tp);
> +		(void)strftime(buf, sizeof(buf), "%e%b%Y", tp);
>  	(void)printf("%-*s", v->width, buf);

This won't fit, it's a 6-char field IIRC so the last two digits of the
year get chopped off.  This, BTW, is the code that produces the
infamous 1Jan70 output :)

Anyway, the point is that in this case the warning is wrong.  The code
is not Y2K safe but it can't be made Y2K safe without breaking the
formatting - and it doesn't even need to be Y2K safe in the first
place since the date displayed is known to lie between boottime and
timeofday so you'd have to have a 100-year uptime for it to become a
problem.

DES
-- 
Dag-Erling Smorgrav - des at ofug.org


More information about the cvs-src mailing list