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 /misc-utils/findmnt.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 'misc-utils/findmnt.c')
-rw-r--r-- | misc-utils/findmnt.c | 76 |
1 files changed, 38 insertions, 38 deletions
diff --git a/misc-utils/findmnt.c b/misc-utils/findmnt.c index 0de8c92a3..b15a52b9d 100644 --- a/misc-utils/findmnt.c +++ b/misc-utils/findmnt.c @@ -1276,44 +1276,44 @@ int main(int argc, char *argv[]) }; static const struct option longopts[] = { - { "all", 0, 0, 'A' }, - { "ascii", 0, 0, 'a' }, - { "bytes", 0, 0, 'b' }, - { "canonicalize", 0, 0, 'c' }, - { "direction", 1, 0, 'd' }, - { "df", 0, 0, 'D' }, - { "evaluate", 0, 0, 'e' }, - { "first-only", 0, 0, 'f' }, - { "fstab", 0, 0, 's' }, - { "help", 0, 0, 'h' }, - { "invert", 0, 0, 'i' }, - { "json", 0, 0, 'J' }, - { "kernel", 0, 0, 'k' }, - { "list", 0, 0, 'l' }, - { "mountpoint", 1, 0, 'M' }, - { "mtab", 0, 0, 'm' }, - { "noheadings", 0, 0, 'n' }, - { "notruncate", 0, 0, 'u' }, - { "options", 1, 0, 'O' }, - { "output", 1, 0, 'o' }, - { "poll", 2, 0, 'p' }, - { "pairs", 0, 0, 'P' }, - { "raw", 0, 0, 'r' }, - { "types", 1, 0, 't' }, - { "nocanonicalize", 0, 0, 'C' }, - { "nofsroot", 0, 0, 'v' }, - { "submounts", 0, 0, 'R' }, - { "source", 1, 0, 'S' }, - { "tab-file", 1, 0, 'F' }, - { "task", 1, 0, 'N' }, - { "target", 1, 0, 'T' }, - { "timeout", 1, 0, 'w' }, - { "uniq", 0, 0, 'U' }, - { "verify", 0, 0, 'x' }, - { "version", 0, 0, 'V' }, - { "verbose", 0, 0, FINDMNT_OPT_VERBOSE }, - { "tree", 0, 0, FINDMNT_OPT_TREE }, - { NULL, 0, 0, 0 } + { "all", no_argument, NULL, 'A' }, + { "ascii", no_argument, NULL, 'a' }, + { "bytes", no_argument, NULL, 'b' }, + { "canonicalize", no_argument, NULL, 'c' }, + { "direction", required_argument, NULL, 'd' }, + { "df", no_argument, NULL, 'D' }, + { "evaluate", no_argument, NULL, 'e' }, + { "first-only", no_argument, NULL, 'f' }, + { "fstab", no_argument, NULL, 's' }, + { "help", no_argument, NULL, 'h' }, + { "invert", no_argument, NULL, 'i' }, + { "json", no_argument, NULL, 'J' }, + { "kernel", no_argument, NULL, 'k' }, + { "list", no_argument, NULL, 'l' }, + { "mountpoint", required_argument, NULL, 'M' }, + { "mtab", no_argument, NULL, 'm' }, + { "noheadings", no_argument, NULL, 'n' }, + { "notruncate", no_argument, NULL, 'u' }, + { "options", required_argument, NULL, 'O' }, + { "output", required_argument, NULL, 'o' }, + { "poll", optional_argument, NULL, 'p' }, + { "pairs", no_argument, NULL, 'P' }, + { "raw", no_argument, NULL, 'r' }, + { "types", required_argument, NULL, 't' }, + { "nocanonicalize", no_argument, NULL, 'C' }, + { "nofsroot", no_argument, NULL, 'v' }, + { "submounts", no_argument, NULL, 'R' }, + { "source", required_argument, NULL, 'S' }, + { "tab-file", required_argument, NULL, 'F' }, + { "task", required_argument, NULL, 'N' }, + { "target", required_argument, NULL, 'T' }, + { "timeout", required_argument, NULL, 'w' }, + { "uniq", no_argument, NULL, 'U' }, + { "verify", no_argument, NULL, 'x' }, + { "version", no_argument, NULL, 'V' }, + { "verbose", no_argument, NULL, FINDMNT_OPT_VERBOSE }, + { "tree", no_argument, NULL, FINDMNT_OPT_TREE }, + { NULL, 0, NULL, 0 } }; static const ul_excl_t excl[] = { /* rows and cols in ASCII order */ |