summaryrefslogtreecommitdiffstats
path: root/term-utils
diff options
context:
space:
mode:
authorSami Kerola2017-02-11 21:23:26 +0100
committerKarel Zak2017-02-20 12:58:49 +0100
commit87918040658f2fa9b1bf78f1f8f4f5c065a2e3a3 (patch)
tree513541cfa347d7fc66e50137603489cb195c86de /term-utils
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 'term-utils')
-rw-r--r--term-utils/agetty.c70
-rw-r--r--term-utils/mesg.c8
-rw-r--r--term-utils/setterm.c2
-rw-r--r--term-utils/wall.c12
4 files changed, 46 insertions, 46 deletions
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,
diff --git a/term-utils/mesg.c b/term-utils/mesg.c
index af9a81ebc..43835b480 100644
--- a/term-utils/mesg.c
+++ b/term-utils/mesg.c
@@ -93,10 +93,10 @@ int main(int argc, char *argv[])
int ch, fd, verbose = FALSE, ret;
static const struct option longopts[] = {
- { "verbose", no_argument, 0, 'v' },
- { "version", no_argument, 0, 'V' },
- { "help", no_argument, 0, 'h' },
- { NULL, 0, 0, 0 }
+ { "verbose", no_argument, NULL, 'v' },
+ { "version", no_argument, NULL, 'V' },
+ { "help", no_argument, NULL, 'h' },
+ { NULL, 0, NULL, 0 }
};
setlocale(LC_ALL, "");
diff --git a/term-utils/setterm.c b/term-utils/setterm.c
index 900a9f3b1..1cf59957b 100644
--- a/term-utils/setterm.c
+++ b/term-utils/setterm.c
@@ -1166,7 +1166,7 @@ static void init_terminal(struct setterm_control *ctl)
int main(int argc, char **argv)
{
- struct setterm_control ctl = { 0 };
+ struct setterm_control ctl = { NULL };
setlocale(LC_ALL, "");
bindtextdomain(PACKAGE, LOCALEDIR);
diff --git a/term-utils/wall.c b/term-utils/wall.c
index fe72e1e1d..6dec05c12 100644
--- a/term-utils/wall.c
+++ b/term-utils/wall.c
@@ -182,12 +182,12 @@ int main(int argc, char **argv)
int mvecsz = 0;
static const struct option longopts[] = {
- { "nobanner", no_argument, 0, 'n' },
- { "timeout", required_argument, 0, 't' },
- { "group", required_argument, 0, 'g' },
- { "version", no_argument, 0, 'V' },
- { "help", no_argument, 0, 'h' },
- { NULL, 0, 0, 0 }
+ { "nobanner", no_argument, NULL, 'n' },
+ { "timeout", required_argument, NULL, 't' },
+ { "group", required_argument, NULL, 'g' },
+ { "version", no_argument, NULL, 'V' },
+ { "help", no_argument, NULL, 'h' },
+ { NULL, 0, NULL, 0 }
};
setlocale(LC_ALL, "");