From 11003f58426fd2b9a92a7a0b4f08e7da90177702 Mon Sep 17 00:00:00 2001 From: nekral-guest Date: Sun, 25 May 2008 22:49:41 +0000 Subject: [PATCH] * libmisc/rlogin.c: Avoid assignments in comparisons. * libmisc/rlogin.c: Avoid implicit conversion of integers to booleans. * libmisc/rlogin.c: Add brackets. --- ChangeLog | 7 +++++++ libmisc/rlogin.c | 8 ++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3b693487..0588a8d7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-05-26 Nicolas François + + * 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 * libmisc/failure.c (failcheck): The failed argument is a bool. diff --git a/libmisc/rlogin.c b/libmisc/rlogin.c index e5259f52..4fe41e06 100644 --- a/libmisc/rlogin.c +++ b/libmisc/rlogin.c @@ -141,8 +141,10 @@ do_rlogin (const char *remote_host, char *name, int namelen, char *term, if ((cp = strchr (term, '/'))) { *cp++ = '\0'; - if (!(remote_speed = atoi (cp))) + remote_speed = atoi (cp); + if (0 == remote_speed) { remote_speed = 9600; + } } for (i = 0; speed_table[i].spd_baud != remote_speed && speed_table[i].spd_name != -1; i++); @@ -165,8 +167,10 @@ do_rlogin (const char *remote_host, char *name, int namelen, char *term, #endif 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; + } /* * ruserok() returns 0 for success on modern systems, and 1 on