]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
chfn: use true/false bool values for semantic clarity
authorChristian Goeschel Ndjomouo <cgoesc2@wgu.edu>
Thu, 15 Jan 2026 04:14:21 +0000 (23:14 -0500)
committerKarel Zak <kzak@redhat.com>
Thu, 29 Jan 2026 11:19:14 +0000 (12:19 +0100)
Signed-off-by: Christian Goeschel Ndjomouo <cgoesc2@wgu.edu>
login-utils/chfn.c

index c5435a8bc44d471dd77901084a88d3207b471b8b..09c38025b48009a136cf359b5205fd731f8954e2 100644 (file)
@@ -180,8 +180,8 @@ static void parse_argv(struct chfn_control *ctl, int argc, char **argv)
                default:
                        errtryhelp(EXIT_FAILURE);
                }
-               ctl->changed = 1;
-               ctl->interactive = 0;
+               ctl->changed = true;
+               ctl->interactive = false;
        }
        if (status != 0)
                exit(EXIT_FAILURE);
@@ -250,13 +250,13 @@ static char *ask_new_field(struct chfn_control *ctl, const char *question,
                }
                if (c_strcasecmp(buf, "none") == 0) {
                        free(buf);
-                       ctl->changed = 1;
+                       ctl->changed = true;
                        return xstrdup("");
                }
                if (check_gecos_string(question, buf) >= 0)
                        break;
        }
-       ctl->changed = 1;
+       ctl->changed = true;
        return buf;
 }
 
@@ -400,7 +400,7 @@ int main(int argc, char **argv)
 {
        uid_t uid;
        struct chfn_control ctl = {
-               .interactive = 1
+               .interactive = true
        };
 
        sanitize_env();