* libmisc/rlogin.c: Avoid assignments in comparisons.

* libmisc/rlogin.c: Avoid implicit conversion of integers to booleans.
	* libmisc/rlogin.c: Add brackets.
This commit is contained in:
nekral-guest 2008-05-25 22:49:41 +00:00
parent c638c3cc3d
commit 11003f5842
2 changed files with 13 additions and 2 deletions

View File

@ -1,3 +1,10 @@
2008-05-26 Nicolas François <nicolas.francois@centraliens.net>
* libmisc/rlogin.c: Avoid assignments in comparisons.
* libmisc/rlogin.c: Avoid implicit conversion of integers to
booleans.
* libmisc/rlogin.c: Add brackets.
2008-05-26 Nicolas François <nicolas.francois@centraliens.net> 2008-05-26 Nicolas François <nicolas.francois@centraliens.net>
* libmisc/failure.c (failcheck): The failed argument is a bool. * libmisc/failure.c (failcheck): The failed argument is a bool.

View File

@ -141,8 +141,10 @@ do_rlogin (const char *remote_host, char *name, int namelen, char *term,
if ((cp = strchr (term, '/'))) { if ((cp = strchr (term, '/'))) {
*cp++ = '\0'; *cp++ = '\0';
if (!(remote_speed = atoi (cp))) remote_speed = atoi (cp);
if (0 == remote_speed) {
remote_speed = 9600; remote_speed = 9600;
}
} }
for (i = 0; speed_table[i].spd_baud != remote_speed && for (i = 0; speed_table[i].spd_baud != remote_speed &&
speed_table[i].spd_name != -1; i++); speed_table[i].spd_name != -1; i++);
@ -165,8 +167,10 @@ do_rlogin (const char *remote_host, char *name, int namelen, char *term,
#endif #endif
STTY (0, &termio); STTY (0, &termio);
if (!(pwd = getpwnam (name))) /* local, no need for xgetpwnam */ pwd = getpwnam (name); /* local, no need for xgetpwnam */
if (NULL == pwd) {
return 0; return 0;
}
/* /*
* ruserok() returns 0 for success on modern systems, and 1 on * ruserok() returns 0 for success on modern systems, and 1 on