]> granicus.if.org Git - shadow/commitdiff
* libmisc/ttytype.c: Add brackets and parenthesis.
authornekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Mon, 20 Apr 2009 11:31:05 +0000 (11:31 +0000)
committernekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Mon, 20 Apr 2009 11:31:05 +0000 (11:31 +0000)
* libmisc/ttytype.c: Avoid assignments in comparisons.

ChangeLog
libmisc/ttytype.c

index 13d8d562434fa6bff7b7b04a3cc695f2c8b3045e..a6bbb393c92eadebe133e451b9d6bcb2202f688e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2009-04-20  Nicolas François  <nicolas.francois@centraliens.net>
+
+       * libmisc/ttytype.c: Add brackets and parenthesis.
+       * libmisc/ttytype.c: Avoid assignments in comparisons.
+
 2009-04-20  Nicolas François  <nicolas.francois@centraliens.net>
 
        * lib/pwio.c, lib/shadowio.c, lib/groupio.c, lib/sgroupio.c: Fill
index d8ecf0a092365ca66b0646bdbbf41d3fbbd4628e..fdaf2dcdb9a0dc49a5e5419466dd85b1ca3e02f7 100644 (file)
@@ -50,12 +50,16 @@ void ttytype (const char *line)
        char type[BUFSIZ];
        char port[BUFSIZ];
 
-       if (getenv ("TERM"))
+       if (getenv ("TERM") != NULL) {
                return;
-       if ((typefile = getdef_str ("TTYTYPE_FILE")) == NULL)
+       }
+       typefile = getdef_str ("TTYTYPE_FILE");
+       if (NULL == typefile) {
                return;
-       if (access (typefile, F_OK) != 0)
+       }
+       if (access (typefile, F_OK) != 0) {
                return;
+       }
 
        fp = fopen (typefile, "r");
        if (NULL == fp) {