From f3bea401e92c2b9ebe12b470ae7767ae9a02971b Mon Sep 17 00:00:00 2001 From: nekral-guest Date: Mon, 20 Apr 2009 11:31:05 +0000 Subject: [PATCH] * libmisc/ttytype.c: Add brackets and parenthesis. * libmisc/ttytype.c: Avoid assignments in comparisons. --- ChangeLog | 5 +++++ libmisc/ttytype.c | 10 +++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 13d8d562..a6bbb393 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-04-20 Nicolas François + + * libmisc/ttytype.c: Add brackets and parenthesis. + * libmisc/ttytype.c: Avoid assignments in comparisons. + 2009-04-20 Nicolas François * lib/pwio.c, lib/shadowio.c, lib/groupio.c, lib/sgroupio.c: Fill diff --git a/libmisc/ttytype.c b/libmisc/ttytype.c index d8ecf0a0..fdaf2dcd 100644 --- a/libmisc/ttytype.c +++ b/libmisc/ttytype.c @@ -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) { -- 2.40.0