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>
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;
version = 1;
break;
case 'w':
- if (optarg && !*optarg)
- write = NULL;
- else
- write = optarg;
+ write = optarg;
break;
case 'h':
err = 0;