diff mbox series

[11/21] multipath: remove pointless code from getopt processing

Message ID 20211118231338.22358-12-mwilck@suse.com (mailing list archive)
State Not Applicable, archived
Delegated to: christophe varoqui
Headers show
Series multipath-tools: coverity fixes | expand

Commit Message

Martin Wilck Nov. 18, 2021, 11:13 p.m. UTC
From: Martin Wilck <mwilck@suse.com>

getopt() never returns 1, and sizeof(optarg) is always sizeof(char *).

Signed-off-by: Martin Wilck <mwilck@suse.com>
---
 multipath/main.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/multipath/main.c b/multipath/main.c
index 9625e97..b7986de 100644
--- a/multipath/main.c
+++ b/multipath/main.c
@@ -842,11 +842,8 @@  main (int argc, char *argv[])
 		condlog(1, "failed to register cleanup handler for vecs: %m");
 	while ((arg = getopt(argc, argv, ":adDcChl::eFfM:v:p:b:BrR:itTquUwW")) != EOF ) {
 		switch(arg) {
-		case 1: printf("optarg : %s\n",optarg);
-			break;
 		case 'v':
-			if (sizeof(optarg) > sizeof(char *) ||
-			    !isdigit(optarg[0])) {
+			if (!isdigit(optarg[0])) {
 				usage (argv[0]);
 				exit(RTVL_FAIL);
 			}