Make the declarations of wday_name and mon_name less eccentric. I

suppose they were legal before, but lint was unhappy about them. It
was probably unhappy for the wrong reasons, but I think it certainly
wasn't something one would want anyway. Declaring a string of length
three to have storage of length three without room for the nul is
asking for trouble even if it does work in context, and there was no
reason not to state how many days there are in a week or months in a
year -- they aren't onerous and aren't going to change.

NOTE: If this code isn't being synced with the central TZCODE stuff,
it probably should be KNFed etc. It is full of K&R declarations,
register, lots of eccentricities, etc.
This commit is contained in:
perry 2006-10-15 15:32:42 +00:00
parent 7bce0c7216
commit 35a6eb4807

View File

@ -1,4 +1,4 @@
/* $NetBSD: asctime.c,v 1.11 2000/09/13 22:32:28 msaitoh Exp $ */
/* $NetBSD: asctime.c,v 1.12 2006/10/15 15:32:42 perry Exp $ */
/*
** This file is in the public domain, so clarified as of
@ -10,7 +10,7 @@
#if 0
static char elsieid[] = "@(#)asctime.c 7.9";
#else
__RCSID("$NetBSD: asctime.c,v 1.11 2000/09/13 22:32:28 msaitoh Exp $");
__RCSID("$NetBSD: asctime.c,v 1.12 2006/10/15 15:32:42 perry Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
@ -42,10 +42,10 @@ asctime_r(timeptr, buf)
register const struct tm * timeptr;
char * buf;
{
static const char wday_name[][3] = {
static const char *wday_name[7] = {
"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
};
static const char mon_name[][3] = {
static const char *mon_name[12] = {
"Jan", "Feb", "Mar", "Apr", "May", "Jun",
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
};