From f9374378ec13ab1630d612b12669efd26f09067e Mon Sep 17 00:00:00 2001 From: Paweł Krawczyk Date: Sat, 20 Jun 2015 16:07:47 +0000 Subject: tac_login is a static array so it's never NULL --- libtac/lib/acct_s.c | 2 +- libtac/lib/authen_s.c | 6 +++--- libtac/lib/author_s.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/libtac/lib/acct_s.c b/libtac/lib/acct_s.c index 929378a..53afa87 100644 --- a/libtac/lib/acct_s.c +++ b/libtac/lib/acct_s.c @@ -78,7 +78,7 @@ int tac_acct_send(int fd, int type, const char *user, char *tty, tb.flags=(u_char) type; tb.authen_method=tac_authen_method; tb.priv_lvl=tac_priv_lvl; - if (tac_login == NULL || !*tac_login) { + if (!*tac_login) { /* default to PAP */ tb.authen_type = TAC_PLUS_AUTHEN_TYPE_PAP; } else { diff --git a/libtac/lib/authen_s.c b/libtac/lib/authen_s.c index 87dcb74..d495931 100644 --- a/libtac/lib/authen_s.c +++ b/libtac/lib/authen_s.c @@ -51,7 +51,7 @@ int tac_authen_send(int fd, const char *user, char *pass, char *tty, th=_tac_req_header(TAC_PLUS_AUTHEN, 0); /* set some header options */ - if (tac_login != NULL && !strcmp(tac_login,"login")) { + if (!strcmp(tac_login,"login")) { th->version = TAC_PLUS_VER_0; } else { th->version = TAC_PLUS_VER_1; @@ -62,7 +62,7 @@ int tac_authen_send(int fd, const char *user, char *pass, char *tty, __FUNCTION__, user, tty, r_addr, \ (tac_encryption) ? "yes" : "no")) - if (tac_login != NULL && !strcmp(tac_login,"chap")) { + if (!strcmp(tac_login,"chap")) { chal_len = strlen(chal); mdp_len = sizeof(u_char) + strlen(pass) + chal_len; mdp = (u_char *) xcalloc(1, mdp_len); @@ -90,7 +90,7 @@ int tac_authen_send(int fd, const char *user, char *pass, char *tty, /* fill the body of message */ tb.action = TAC_PLUS_AUTHEN_LOGIN; tb.priv_lvl = tac_priv_lvl; - if (tac_login == NULL || !*tac_login) { + if (!*tac_login) { /* default to PAP */ tb.authen_type = TAC_PLUS_AUTHEN_TYPE_PAP; } else { diff --git a/libtac/lib/author_s.c b/libtac/lib/author_s.c index 56f1a97..7c18400 100644 --- a/libtac/lib/author_s.c +++ b/libtac/lib/author_s.c @@ -63,7 +63,7 @@ int tac_author_send(int fd, const char *user, char *tty, char *r_addr, tb.authen_method = tac_authen_method; tb.priv_lvl = tac_priv_lvl; - if (tac_login == NULL) { + if (!*tac_login) { /* default to PAP */ tb.authen_type = TAC_PLUS_AUTHEN_TYPE_PAP; } else { -- cgit v1.2.3