]> granicus.if.org Git - shadow/commitdiff
* libmisc/rlogin.c: Avoid assignments in comparisons.
authornekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Sun, 25 May 2008 22:49:41 +0000 (22:49 +0000)
committernekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Sun, 25 May 2008 22:49:41 +0000 (22:49 +0000)
* libmisc/rlogin.c: Avoid implicit conversion of integers to booleans.
* libmisc/rlogin.c: Add brackets.

ChangeLog
libmisc/rlogin.c

index 3b693487e0444ae2591a1b8a68f9e87d0773092d..0588a8d7ceb8cb134245115f8b4b4ac7627cfaaf 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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>
 
        * libmisc/failure.c (failcheck): The failed argument is a bool.
index e5259f52db9a8e4b5f3d1fcffb23cd09a98830ba..4fe41e06aba49e7438d6ecbcb7a200a7efebc230 100644 (file)
@@ -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