From: Christian Goeschel Ndjomouo Date: Wed, 14 Jan 2026 05:41:14 +0000 (-0500) Subject: chfn: use direct equality check for semantic clarity and readability X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2653558bdc5e9959cfc07e1c286c76a539f02619;p=thirdparty%2Futil-linux.git chfn: use direct equality check for semantic clarity and readability Signed-off-by: Christian Goeschel Ndjomouo --- diff --git a/login-utils/chfn.c b/login-utils/chfn.c index b7cae6176..c5435a8bc 100644 --- a/login-utils/chfn.c +++ b/login-utils/chfn.c @@ -248,7 +248,7 @@ static char *ask_new_field(struct chfn_control *ctl, const char *question, free(buf); return xstrdup(def_val); } - if (!c_strcasecmp(buf, "none")) { + if (c_strcasecmp(buf, "none") == 0) { free(buf); ctl->changed = 1; return xstrdup(""); @@ -276,11 +276,11 @@ static void get_login_defs(struct chfn_control *ctl) return; } s = getlogindefs_str("CHFN_RESTRICT", ""); - if (!strcmp(s, "yes")) { + if (strcmp(s, "yes") == 0) { ctl->allow_room = ctl->allow_work = ctl->allow_home = 1; return; } - if (!strcmp(s, "no")) { + if (strcmp(s, "no") == 0) { ctl->allow_fullname = ctl->allow_room = ctl->allow_work = ctl->allow_home = 1; return; }