diff options
author | Theodore Ts'o <tytso@mit.edu> | 2014-01-30 18:02:37 -0500 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2014-01-30 18:25:15 -0500 |
commit | e5397d7ae9d87388201c16d25e0615bd2180cb3f (patch) | |
tree | 20d89f2baaab6e9cee10ac0dc9c83f37a4e344d3 | |
parent | 9b36ce0e195c5ba7bb03dd8baceacc5dfa7a4c20 (diff) | |
download | e2fsprogs-e5397d7ae9d87388201c16d25e0615bd2180cb3f.tar.gz |
blkid: suppress Coverity warning
The getopt() function will never let optarg be NULL (at least without
using the GNU double-colon extension, which we don't use because it's
not portable), so don't bother checking for that case. It's harmless,
but it triggers a Coverity warning elsewhere, since it thinks optarg
could in fact be NULL.
Addresses-Coverity-Id: #1049156
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
-rw-r--r-- | misc/blkid.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/misc/blkid.c b/misc/blkid.c index 55808af8..96fffae4 100644 --- a/misc/blkid.c +++ b/misc/blkid.c @@ -293,10 +293,7 @@ int main(int argc, char **argv) while ((c = getopt (argc, argv, "c:f:ghlLo:s:t:w:v")) != EOF) switch (c) { case 'c': - if (optarg && !*optarg) - read = NULL; - else - read = optarg; + read = optarg; if (!write) write = read; break; @@ -349,10 +346,7 @@ int main(int argc, char **argv) version = 1; break; case 'w': - if (optarg && !*optarg) - write = NULL; - else - write = optarg; + write = optarg; break; case 'h': err = 0; |