diff options
author | Sami Kerola | 2017-02-11 21:23:26 +0100 |
---|---|---|
committer | Karel Zak | 2017-02-20 12:58:49 +0100 |
commit | 87918040658f2fa9b1bf78f1f8f4f5c065a2e3a3 (patch) | |
tree | 513541cfa347d7fc66e50137603489cb195c86de /sys-utils/tunelp.c | |
parent | cfdisk: avoid use of VLA in combination with sizeof() [smatch scan] (diff) | |
download | kernel-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 'sys-utils/tunelp.c')
-rw-r--r-- | sys-utils/tunelp.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/sys-utils/tunelp.c b/sys-utils/tunelp.c index 7b38255d6..8cfbe80a2 100644 --- a/sys-utils/tunelp.c +++ b/sys-utils/tunelp.c @@ -148,7 +148,7 @@ int main(int argc, char **argv) print_usage(stderr); cmdst = cmds = xmalloc(sizeof(struct command)); - cmds->next = 0; + cmds->next = NULL; show_irq = 1; while ((c = getopt_long(argc, argv, "t:c:w:a:i:ho:C:sq:rT:vV", longopts, NULL)) != -1) { @@ -161,35 +161,35 @@ int main(int argc, char **argv) cmds->val = strtol_or_err(optarg, _("argument error")); cmds->next = xmalloc(sizeof(struct command)); cmds = cmds->next; - cmds->next = 0; + cmds->next = NULL; break; case 't': cmds->op = LPTIME; cmds->val = strtol_or_err(optarg, _("argument error")); cmds->next = xmalloc(sizeof(struct command)); cmds = cmds->next; - cmds->next = 0; + cmds->next = NULL; break; case 'c': cmds->op = LPCHAR; cmds->val = strtol_or_err(optarg, _("argument error")); cmds->next = xmalloc(sizeof(struct command)); cmds = cmds->next; - cmds->next = 0; + cmds->next = NULL; break; case 'w': cmds->op = LPWAIT; cmds->val = strtol_or_err(optarg, _("argument error")); cmds->next = xmalloc(sizeof(struct command)); cmds = cmds->next; - cmds->next = 0; + cmds->next = NULL; break; case 'a': cmds->op = LPABORT; cmds->val = parse_switch(optarg, _("argument error"), "on", "off", NULL); cmds->next = xmalloc(sizeof(struct command)); cmds = cmds->next; - cmds->next = 0; + cmds->next = NULL; break; case 'q': show_irq = parse_switch(optarg, _("argument error"), "on", "off", NULL); @@ -199,14 +199,14 @@ int main(int argc, char **argv) cmds->val = parse_switch(optarg, _("argument error"), "on", "off", NULL); cmds->next = xmalloc(sizeof(struct command)); cmds = cmds->next; - cmds->next = 0; + cmds->next = NULL; break; case 'C': cmds->op = LPCAREFUL; cmds->val = parse_switch(optarg, _("argument error"), "on", "off", NULL); cmds->next = xmalloc(sizeof(struct command)); cmds = cmds->next; - cmds->next = 0; + cmds->next = NULL; break; case 's': show_irq = 0; @@ -214,14 +214,14 @@ int main(int argc, char **argv) cmds->val = 0; cmds->next = xmalloc(sizeof(struct command)); cmds = cmds->next; - cmds->next = 0; + cmds->next = NULL; break; case 'r': cmds->op = LPRESET; cmds->val = 0; cmds->next = xmalloc(sizeof(struct command)); cmds = cmds->next; - cmds->next = 0; + cmds->next = NULL; break; case 'T': /* Note: this will do the wrong thing on @@ -231,7 +231,7 @@ int main(int argc, char **argv) cmds->val = parse_switch(optarg, _("argument error"), "on", "off", NULL); cmds->next = xmalloc(sizeof(struct command)); cmds = cmds->next; - cmds->next = 0; + cmds->next = NULL; break; case 'v': case 'V': |