* libmisc/console.c, libmisc/hushed.c, libmisc/yesno.c,

libmisc/loginprompt.c, libmisc/ttytype.c, libmisc/tz.c,
	src/login_nopam.c, src/chpasswd.c, src/chgpasswd.c, lib/port.c:
	The size argument of fgets is an int, not a size_t.
	* libmisc/loginprompt.c: Ignore the return value from signal()
	when the signal handlers are restored.
	* src/chpasswd.c: Cast the return value of time() to a long
	integer.
	* src/chpasswd.c: Use the SCALE macro instead of (24L * 3600L)
	for the values to be set in /etc/shadow.
This commit is contained in:
nekral-guest
2008-06-13 18:11:09 +00:00
parent 55b2e44814
commit ef32209fd7
10 changed files with 14 additions and 13 deletions

View File

@@ -93,7 +93,7 @@ static bool is_listed (const char *cfgin, const char *tty, bool def)
* See if this tty is listed in the console file.
*/
while (fgets (buf, sizeof (buf), fp) != NULL) {
while (fgets (buf, (int) sizeof (buf), fp) != NULL) {
buf[strlen (buf) - 1] = '\0';
if (strcmp (buf, tty) == 0) {
(void) fclose (fp);

View File

@@ -83,7 +83,7 @@ bool hushed (const struct passwd *pw)
if (NULL == fp) {
return false;
}
for (found = false; !found && (fgets (buf, sizeof buf, fp) == buf);) {
for (found = false; !found && (fgets (buf, (int) sizeof buf, fp) == buf);) {
buf[strlen (buf) - 1] = '\0';
found = (strcmp (buf, pw->pw_shell) == 0) ||
(strcmp (buf, pw->pw_name) == 0);

View File

@@ -109,7 +109,7 @@ void login_prompt (const char *prompt, char *name, int namesize)
*/
memzero (buf, sizeof buf);
if (fgets (buf, sizeof buf, stdin) != buf) {
if (fgets (buf, (int) sizeof buf, stdin) != buf) {
exit (1);
}
@@ -167,9 +167,9 @@ void login_prompt (const char *prompt, char *name, int namesize)
* Set the SIGQUIT handler back to its original value
*/
signal (SIGQUIT, sigquit);
(void) signal (SIGQUIT, sigquit);
#ifdef SIGTSTP
signal (SIGTSTP, sigtstp);
(void) signal (SIGTSTP, sigtstp);
#endif
}

View File

@@ -62,7 +62,7 @@ void ttytype (const char *line)
perror (typefile);
return;
}
while (fgets (buf, sizeof buf, fp) == buf) {
while (fgets (buf, (int) sizeof buf, fp) == buf) {
if (buf[0] == '#') {
continue;
}

View File

@@ -53,7 +53,7 @@ char *tz (const char *fname)
const char *def_tz = "TZ=CST6CDT";
if ((fp = fopen (fname, "r")) == NULL ||
fgets (tzbuf, sizeof (tzbuf), fp) == NULL) {
fgets (tzbuf, (int) sizeof (tzbuf), fp) == NULL) {
#ifndef USE_PAM
if (!(def_tz = getdef_str ("ENV_TZ")) || def_tz[0] == '/')
def_tz = "TZ=CST6CDT";

View File

@@ -70,7 +70,7 @@ bool yes_or_no (bool read_only)
* Get a line and see what the first character is.
*/
/* TODO: use gettext */
if (fgets (buf, sizeof buf, stdin) == buf) {
if (fgets (buf, (int) sizeof buf, stdin) == buf) {
return buf[0] == 'y' || buf[0] == 'Y';
}