Fix some compilation warnings:

* src/login.c: "dereferencing type-punned pointer will break
   strict-aliasing rules", add a variable indirection: ptr_pam_user.
 * lib/commonio.c: do not initialize the sb stat structure.
 * lib/pwio.c, lib/shadowio.c, lib/sgroupio.c, lib/groupio.c:
   initialize the security context if WITH_SELINUX.
 * lib/nscd.c: The service argument is not const (used in the exec*
   parameters). This matches with the prototype definition.
 * src/groupmems.c: Avoid ++i when i is also used in the same line.
 * src/newusers.c: i is positive every time it is compared. Add
   cast to unsigned int.
 * src/nologin.c: Use a main() prototype with no arguments.
 * libmisc/getdate.y: Initialize the type and value fields of the
   terminating entry for each TABLE.
 * libmisc/tz.c: Use "TZ=CST6CDT" as the default timezone.
This commit is contained in:
nekral-guest
2007-11-19 20:25:36 +00:00
parent d16cc1ea89
commit 39e5c0a1ab
13 changed files with 49 additions and 17 deletions

View File

@@ -464,7 +464,7 @@ static TABLE const MonthDayTable[] = {
{ "thurs", tDAY, 4 },
{ "friday", tDAY, 5 },
{ "saturday", tDAY, 6 },
{ NULL }
{ NULL, 0, 0 }
};
/* Time units table. */
@@ -479,7 +479,7 @@ static TABLE const UnitsTable[] = {
{ "min", tMINUTE_UNIT, 1 },
{ "second", tSEC_UNIT, 1 },
{ "sec", tSEC_UNIT, 1 },
{ NULL }
{ NULL, 0, 0 }
};
/* Assorted relative-time words. */
@@ -504,7 +504,7 @@ static TABLE const OtherTable[] = {
{ "eleventh", tUNUMBER, 11 },
{ "twelfth", tUNUMBER, 12 },
{ "ago", tAGO, 1 },
{ NULL }
{ NULL, 0, 0 }
};
/* The timezone table. */
@@ -559,7 +559,7 @@ static TABLE const TimezoneTable[] = {
{ "nzst", tZONE, -HOUR (12) }, /* New Zealand Standard */
{ "nzdt", tDAYZONE, -HOUR (12) }, /* New Zealand Daylight */
{ "idle", tZONE, -HOUR (12) }, /* International Date Line East */
{ NULL }
{ NULL, 0, 0 }
};
/* Military timezone table. */
@@ -589,7 +589,7 @@ static TABLE const MilitaryTable[] = {
{ "x", tZONE, HOUR (-11) },
{ "y", tZONE, HOUR (-12) },
{ "z", tZONE, HOUR ( 0) },
{ NULL }
{ NULL, 0, 0 }
};

View File

@@ -45,7 +45,7 @@ char *tz (const char *fname)
{
FILE *fp = 0;
static char tzbuf[BUFSIZ];
const char *def_tz;
const char *def_tz = "TZ=CST6CDT";
if ((fp = fopen (fname, "r")) == NULL ||
fgets (tzbuf, sizeof (tzbuf), fp) == NULL) {