Subject: bin/34074: remove uneeded case's
To: None <gnats-admin@netbsd.org, netbsd-bugs@netbsd.org>
From: None <new.security@gmail.com>
List: netbsd-bugs
Date: 07/25/2006 04:20:01
>Number: 34074
>Category: bin
>Synopsis: remove uneeded case's
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: bin-bug-people
>State: open
>Class: change-request
>Submitter-Id: net
>Arrival-Date: Tue Jul 25 04:20:00 +0000 2006
>Originator: Kevin Massey
>Release:
>Organization:
>Environment:
>Description:
many times case '?' is used right before default: and it is not needed.
>How-To-Repeat:
>Fix:
Index: chmod/chmod.c
===================================================================
RCS file: /cvsroot/src/bin/chmod/chmod.c,v
retrieving revision 1.33
diff -u -r1.33 chmod.c
--- chmod/chmod.c 1 Oct 2005 20:09:18 -0000 1.33
+++ chmod/chmod.c 24 Jul 2006 21:28:35 -0000
@@ -118,7 +118,6 @@
argv[optind - 1][2] == '\0')
--optind;
goto done;
- case '?':
default:
usage();
}
Index: cp/cp.c
===================================================================
RCS file: /cvsroot/src/bin/cp/cp.c,v
retrieving revision 1.44
diff -u -r1.44 cp.c
--- cp/cp.c 16 Jul 2006 16:22:24 -0000 1.44
+++ cp/cp.c 24 Jul 2006 21:28:35 -0000
@@ -142,7 +142,6 @@
case 'v':
vflag = 1;
break;
- case '?':
default:
usage();
/* NOTREACHED */
Index: df/df.c
===================================================================
RCS file: /cvsroot/src/bin/df/df.c,v
retrieving revision 1.70
diff -u -r1.70 df.c
--- df/df.c 17 Mar 2006 13:53:31 -0000 1.70
+++ df/df.c 24 Jul 2006 21:28:35 -0000
@@ -123,7 +123,6 @@
errx(1, "only one -t option may be specified.");
maketypelist(optarg);
break;
- case '?':
default:
usage();
}
Index: domainname/domainname.c
===================================================================
RCS file: /cvsroot/src/bin/domainname/domainname.c,v
retrieving revision 1.13
diff -u -r1.13 domainname.c
--- domainname/domainname.c 19 Apr 2004 08:24:56 -0000 1.13
+++ domainname/domainname.c 24 Jul 2006 21:28:35 -0000
@@ -64,7 +64,6 @@
while ((ch = getopt(argc, argv, "")) != -1) {
switch (ch) {
- case '?':
default:
usage();
/* NOTREACHED */
Index: hostname/hostname.c
===================================================================
RCS file: /cvsroot/src/bin/hostname/hostname.c,v
retrieving revision 1.15
diff -u -r1.15 hostname.c
--- hostname/hostname.c 7 Aug 2003 09:05:13 -0000 1.15
+++ hostname/hostname.c 24 Jul 2006 21:28:36 -0000
@@ -67,7 +67,6 @@
case 's':
sflag = 1;
break;
- case '?':
default:
usage();
}
Index: ln/ln.c
===================================================================
RCS file: /cvsroot/src/bin/ln/ln.c,v
retrieving revision 1.30
diff -u -r1.30 ln.c
--- ln/ln.c 26 Jun 2005 19:10:49 -0000 1.30
+++ ln/ln.c 24 Jul 2006 21:28:36 -0000
@@ -89,7 +89,6 @@
case 'v':
vflag = 1;
break;
- case '?':
default:
usage();
/* NOTREACHED */
Index: ls/ls.c
===================================================================
RCS file: /cvsroot/src/bin/ls/ls.c,v
retrieving revision 1.59
diff -u -r1.59 ls.c
--- ls/ls.c 22 Mar 2006 16:20:34 -0000 1.59
+++ ls/ls.c 24 Jul 2006 21:28:36 -0000
@@ -267,7 +267,6 @@
f_octal_escape = 0;
break;
default:
- case '?':
usage();
}
}
Index: mkdir/mkdir.c
===================================================================
RCS file: /cvsroot/src/bin/mkdir/mkdir.c,v
retrieving revision 1.36
diff -u -r1.36 mkdir.c
--- mkdir/mkdir.c 1 Oct 2005 20:22:29 -0000 1.36
+++ mkdir/mkdir.c 24 Jul 2006 21:28:36 -0000
@@ -93,7 +93,6 @@
mode = getmode(set, S_IRWXU | S_IRWXG | S_IRWXO);
free(set);
break;
- case '?':
default:
usage();
/* NOTREACHED */
Index: mt/mt.c
===================================================================
RCS file: /cvsroot/src/bin/mt/mt.c,v
retrieving revision 1.42
diff -u -r1.42 mt.c
--- mt/mt.c 22 Mar 2006 01:45:08 -0000 1.42
+++ mt/mt.c 24 Jul 2006 21:28:36 -0000
@@ -131,7 +131,6 @@
case 't':
tape = optarg;
break;
- case '?':
default:
usage();
}
Index: mv/mv.c
===================================================================
RCS file: /cvsroot/src/bin/mv/mv.c,v
retrieving revision 1.35
diff -u -r1.35 mv.c
--- mv/mv.c 3 Jun 2005 13:55:04 -0000 1.35
+++ mv/mv.c 24 Jul 2006 21:28:36 -0000
@@ -97,7 +97,6 @@
case 'v':
vflg = 1;
break;
- case '?':
default:
usage();
}
Index: pax/options.c
===================================================================
RCS file: /cvsroot/src/bin/pax/options.c,v
retrieving revision 1.97
diff -u -r1.97 options.c
--- pax/options.c 16 Apr 2006 16:20:21 -0000 1.97
+++ pax/options.c 24 Jul 2006 21:28:36 -0000
@@ -634,7 +634,6 @@
case OPT_FORCE_LOCAL:
forcelocal = 0;
break;
- case '?':
default:
pax_usage();
break;
Index: ps/ps.c
===================================================================
RCS file: /cvsroot/src/bin/ps/ps.c,v
retrieving revision 1.59
diff -u -r1.59 ps.c
--- ps/ps.c 26 Jun 2005 19:10:49 -0000 1.59
+++ ps/ps.c 24 Jul 2006 21:28:36 -0000
@@ -336,7 +336,6 @@
case 'x':
xflg = 1;
break;
- case '?':
default:
usage();
}
Index: pwd/pwd.c
===================================================================
RCS file: /cvsroot/src/bin/pwd/pwd.c,v
retrieving revision 1.19
diff -u -r1.19 pwd.c
--- pwd/pwd.c 30 Oct 2003 13:52:23 -0000 1.19
+++ pwd/pwd.c 24 Jul 2006 21:28:36 -0000
@@ -81,7 +81,6 @@
case 'P':
lFlag = 0;
break;
- case '?':
default:
usage();
}
Index: rcp/rcp.c
===================================================================
RCS file: /cvsroot/src/bin/rcp/rcp.c,v
retrieving revision 1.42
diff -u -r1.42 rcp.c
--- rcp/rcp.c 20 Mar 2006 04:03:10 -0000 1.42
+++ rcp/rcp.c 24 Jul 2006 21:28:36 -0000
@@ -126,7 +126,6 @@
iamremote = 1;
tflag = 1;
break;
- case '?':
default:
usage();
}
Index: rm/rm.c
===================================================================
RCS file: /cvsroot/src/bin/rm/rm.c,v
retrieving revision 1.43
diff -u -r1.43 rm.c
--- rm/rm.c 17 Mar 2006 23:55:42 -0000 1.43
+++ rm/rm.c 24 Jul 2006 21:28:36 -0000
@@ -119,7 +119,6 @@
case 'W':
Wflag = 1;
break;
- case '?':
default:
usage();
}
Index: rmdir/rmdir.c
===================================================================
RCS file: /cvsroot/src/bin/rmdir/rmdir.c,v
retrieving revision 1.23
diff -u -r1.23 rmdir.c
--- rmdir/rmdir.c 29 Sep 2003 21:11:15 -0000 1.23
+++ rmdir/rmdir.c 24 Jul 2006 21:28:36 -0000
@@ -71,7 +71,6 @@
case 'p':
pflag = 1;
break;
- case '?':
default:
usage();
}
Index: sleep/sleep.c
===================================================================
RCS file: /cvsroot/src/bin/sleep/sleep.c,v
retrieving revision 1.20
diff -u -r1.20 sleep.c
--- sleep/sleep.c 17 Oct 2005 10:11:46 -0000 1.20
+++ sleep/sleep.c 24 Jul 2006 21:28:37 -0000
@@ -72,7 +72,6 @@
while ((ch = getopt(argc, argv, "")) != -1)
switch(ch) {
- case '?':
default:
usage();
}
Index: stty/stty.c
===================================================================
RCS file: /cvsroot/src/bin/stty/stty.c,v
retrieving revision 1.19
diff -u -r1.19 stty.c
--- stty/stty.c 7 Aug 2003 09:05:42 -0000 1.19
+++ stty/stty.c 24 Jul 2006 21:28:37 -0000
@@ -89,7 +89,6 @@
case 'g':
fmt = STTY_GFLAG;
break;
- case '?':
default:
goto args;
}