diff options
author | Karel Zak | 2011-09-13 11:21:47 +0200 |
---|---|---|
committer | Karel Zak | 2011-09-13 11:21:47 +0200 |
commit | 5b66cfae9113a79645890a389c862deda35acbe2 (patch) | |
tree | 4a27f24b58501225f6f3ec276a00b78076cb25b5 /login-utils/chfn.c | |
parent | build-sys: add err and errx to smatch no_return_funcs (diff) | |
download | kernel-qcow2-util-linux-5b66cfae9113a79645890a389c862deda35acbe2.tar.gz kernel-qcow2-util-linux-5b66cfae9113a79645890a389c862deda35acbe2.tar.xz kernel-qcow2-util-linux-5b66cfae9113a79645890a389c862deda35acbe2.zip |
chfn: remove non-ANSI definitions [smatch scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'login-utils/chfn.c')
-rw-r--r-- | login-utils/chfn.c | 30 |
1 files changed, 8 insertions, 22 deletions
diff --git a/login-utils/chfn.c b/login-utils/chfn.c index 59aefb197..902fe9c81 100644 --- a/login-utils/chfn.c +++ b/login-utils/chfn.c @@ -235,10 +235,7 @@ int main (int argc, char **argv) { * parse the command line arguments. * returns true if no information beyond the username was given. */ -static boolean parse_argv (argc, argv, pinfo) - int argc; - char *argv[]; - struct finfo *pinfo; +static boolean parse_argv(int argc, char *argv[], struct finfo *pinfo) { int index, c, status; boolean info_given; @@ -316,9 +313,7 @@ static boolean parse_argv (argc, argv, pinfo) * take a struct password and fill in the fields of the * struct finfo. */ -static void parse_passwd (pw, pinfo) - struct passwd *pw; - struct finfo *pinfo; +static void parse_passwd(struct passwd *pw, struct finfo *pinfo) { char *gecos; char *cp; @@ -351,9 +346,7 @@ static void parse_passwd (pw, pinfo) * ask_info () -- * prompt the user for the finger information and store it. */ -static void ask_info (oldfp, newfp) - struct finfo *oldfp; - struct finfo *newfp; +static void ask_info(struct finfo *oldfp, struct finfo *newfp) { newfp->full_name = prompt (_("Name"), oldfp->full_name); newfp->office = prompt (_("Office"), oldfp->office); @@ -366,14 +359,12 @@ static void ask_info (oldfp, newfp) * prompt () -- * ask the user for a given field and check that the string is legal. */ -static char *prompt (question, def_val) - char *question; - char *def_val; +static char *prompt(char *question, char *def_val) { static char *blank = "none"; int len; char *ans, *cp; - + while (true) { if (! def_val) def_val = ""; printf("%s [%s]: ", question, def_val); @@ -403,9 +394,7 @@ static char *prompt (question, def_val) * output "msg" followed by a description of the problem, and * return (-1). */ -static int check_gecos_string (msg, gecos) - char *msg; - char *gecos; +static int check_gecos_string(char *msg, char *gecos) { unsigned int i, c; @@ -436,9 +425,7 @@ static int check_gecos_string (msg, gecos) * set_changed_data () -- * incorporate the new data into the old finger info. */ -static boolean set_changed_data (oldfp, newfp) - struct finfo *oldfp; - struct finfo *newfp; +static boolean set_changed_data(struct finfo *oldfp, struct finfo *newfp) { boolean changed = false; @@ -459,8 +446,7 @@ static boolean set_changed_data (oldfp, newfp) * save the given finger info in /etc/passwd. * return zero on success. */ -static int save_new_data (pinfo) - struct finfo *pinfo; +static int save_new_data(struct finfo *pinfo) { char *gecos; int len; |