Date: Sun, 04 May 2003 00:29:28 +0200 From: Dag-Erling Smorgrav <des@ofug.org> To: Giorgos Keramidas <keramida@ceid.upatras.gr> Cc: cvs-all@FreeBSD.org Subject: Re: 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 Message-ID: <xzpu1cbirzr.fsf@flood.ping.uio.no> In-Reply-To: <20030503210442.GC3907@gothmog.gr> (Giorgos Keramidas's message of "Sun, 4 May 2003 00:04:42 %2B0300") References: <200305031639.h43GdYQ4049867@repoman.freebsd.org> <20030503205500.GB3907@gothmog.gr> <20030503210442.GC3907@gothmog.gr>
next in thread | previous in thread | raw e-mail | index | archive | help
Giorgos Keramidas <keramida@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@ofug.org
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?xzpu1cbirzr.fsf>