From 87918040658f2fa9b1bf78f1f8f4f5c065a2e3a3 Mon Sep 17 00:00:00 2001 From: Sami Kerola Date: Sat, 11 Feb 2017 20:23:26 +0000 Subject: 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 --- term-utils/agetty.c | 70 ++++++++++++++++++++++++++--------------------------- 1 file changed, 35 insertions(+), 35 deletions(-) (limited to 'term-utils/agetty.c') diff --git a/term-utils/agetty.c b/term-utils/agetty.c index 830128e84..8ac08f57c 100644 --- a/term-utils/agetty.c +++ b/term-utils/agetty.c @@ -628,41 +628,41 @@ static void parse_args(int argc, char **argv, struct options *op) RELOAD_OPTION, }; const struct option longopts[] = { - { "8bits", no_argument, 0, '8' }, - { "autologin", required_argument, 0, 'a' }, - { "noreset", no_argument, 0, 'c' }, - { "chdir", required_argument, 0, 'C' }, - { "delay", required_argument, 0, 'd' }, - { "remote", no_argument, 0, 'E' }, - { "issue-file", required_argument, 0, 'f' }, - { "flow-control", no_argument, 0, 'h' }, - { "host", required_argument, 0, 'H' }, - { "noissue", no_argument, 0, 'i' }, - { "init-string", required_argument, 0, 'I' }, - { "noclear", no_argument, 0, 'J' }, - { "login-program", required_argument, 0, 'l' }, - { "local-line", optional_argument, 0, 'L' }, - { "extract-baud", no_argument, 0, 'm' }, - { "skip-login", no_argument, 0, 'n' }, - { "nonewline", no_argument, 0, 'N' }, - { "login-options", required_argument, 0, 'o' }, - { "login-pause", no_argument, 0, 'p' }, - { "nice", required_argument, 0, 'P' }, - { "chroot", required_argument, 0, 'r' }, - { "hangup", no_argument, 0, 'R' }, - { "keep-baud", no_argument, 0, 's' }, - { "timeout", required_argument, 0, 't' }, - { "detect-case", no_argument, 0, 'U' }, - { "wait-cr", no_argument, 0, 'w' }, - { "nohints", no_argument, 0, NOHINTS_OPTION }, - { "nohostname", no_argument, 0, NOHOSTNAME_OPTION }, - { "long-hostname", no_argument, 0, LONGHOSTNAME_OPTION }, - { "reload", no_argument, 0, RELOAD_OPTION }, - { "version", no_argument, 0, VERSION_OPTION }, - { "help", no_argument, 0, HELP_OPTION }, - { "erase-chars", required_argument, 0, ERASE_CHARS_OPTION }, - { "kill-chars", required_argument, 0, KILL_CHARS_OPTION }, - { NULL, 0, 0, 0 } + { "8bits", no_argument, NULL, '8' }, + { "autologin", required_argument, NULL, 'a' }, + { "noreset", no_argument, NULL, 'c' }, + { "chdir", required_argument, NULL, 'C' }, + { "delay", required_argument, NULL, 'd' }, + { "remote", no_argument, NULL, 'E' }, + { "issue-file", required_argument, NULL, 'f' }, + { "flow-control", no_argument, NULL, 'h' }, + { "host", required_argument, NULL, 'H' }, + { "noissue", no_argument, NULL, 'i' }, + { "init-string", required_argument, NULL, 'I' }, + { "noclear", no_argument, NULL, 'J' }, + { "login-program", required_argument, NULL, 'l' }, + { "local-line", optional_argument, NULL, 'L' }, + { "extract-baud", no_argument, NULL, 'm' }, + { "skip-login", no_argument, NULL, 'n' }, + { "nonewline", no_argument, NULL, 'N' }, + { "login-options", required_argument, NULL, 'o' }, + { "login-pause", no_argument, NULL, 'p' }, + { "nice", required_argument, NULL, 'P' }, + { "chroot", required_argument, NULL, 'r' }, + { "hangup", no_argument, NULL, 'R' }, + { "keep-baud", no_argument, NULL, 's' }, + { "timeout", required_argument, NULL, 't' }, + { "detect-case", no_argument, NULL, 'U' }, + { "wait-cr", no_argument, NULL, 'w' }, + { "nohints", no_argument, NULL, NOHINTS_OPTION }, + { "nohostname", no_argument, NULL, NOHOSTNAME_OPTION }, + { "long-hostname", no_argument, NULL, LONGHOSTNAME_OPTION }, + { "reload", no_argument, NULL, RELOAD_OPTION }, + { "version", no_argument, NULL, VERSION_OPTION }, + { "help", no_argument, NULL, HELP_OPTION }, + { "erase-chars", required_argument, NULL, ERASE_CHARS_OPTION }, + { "kill-chars", required_argument, NULL, KILL_CHARS_OPTION }, + { NULL, 0, NULL, 0 } }; while ((c = getopt_long(argc, argv, -- cgit v1.2.3-55-g7522