summaryrefslogtreecommitdiffstats
path: root/login-utils/chsh.c
diff options
context:
space:
mode:
authorSami Kerola2017-02-11 21:23:26 +0100
committerKarel Zak2017-02-20 12:58:49 +0100
commit87918040658f2fa9b1bf78f1f8f4f5c065a2e3a3 (patch)
tree513541cfa347d7fc66e50137603489cb195c86de /login-utils/chsh.c
parentcfdisk: avoid use of VLA in combination with sizeof() [smatch scan] (diff)
downloadkernel-qcow2-util-linux-87918040658f2fa9b1bf78f1f8f4f5c065a2e3a3.tar.gz
kernel-qcow2-util-linux-87918040658f2fa9b1bf78f1f8f4f5c065a2e3a3.tar.xz
kernel-qcow2-util-linux-87918040658f2fa9b1bf78f1f8f4f5c065a2e3a3.zip
misc: do not use plain 0 as NULL [smatch scan]
text-utils/tailf.c:69:21: warning: Using plain integer as NULL pointer Since many 'struct option' has used zero as NULL make them more readable in same go by reindenting, and using named argument requirements. Reference: https://lwn.net/Articles/93577/ Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Diffstat (limited to 'login-utils/chsh.c')
-rw-r--r--login-utils/chsh.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/login-utils/chsh.c b/login-utils/chsh.c
index c7defd49f..979a287fe 100644
--- a/login-utils/chsh.c
+++ b/login-utils/chsh.c
@@ -129,11 +129,11 @@ static int get_shell_list(const char *shell_name)
static void parse_argv(int argc, char **argv, struct sinfo *pinfo)
{
static const struct option long_options[] = {
- {"shell", required_argument, 0, 's'},
- {"list-shells", no_argument, 0, 'l'},
- {"help", no_argument, 0, 'h'},
- {"version", no_argument, 0, 'v'},
- {NULL, no_argument, 0, '0'},
+ {"shell", required_argument, NULL, 's'},
+ {"list-shells", no_argument, NULL, 'l'},
+ {"help", no_argument, NULL, 'h'},
+ {"version", no_argument, NULL, 'v'},
+ {NULL, 0, NULL, 0},
};
int c;
@@ -227,7 +227,7 @@ int main(int argc, char **argv)
char *oldshell;
int nullshell = 0;
const uid_t uid = getuid();
- struct sinfo info = { 0 };
+ struct sinfo info = { NULL };
struct passwd *pw;
sanitize_env();