summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorJared Yanovich <jaredy@cvs.openbsd.org>2005-03-25 16:54:18 +0000
committerJared Yanovich <jaredy@cvs.openbsd.org>2005-03-25 16:54:18 +0000
commitb3ec4210d69766f5f31f3800f470e51633f41b8f (patch)
tree95f9b0b416302a7807019fcdd1680d5da42496e1 /usr.sbin
parentc3ee6accf7f4f65c992c9f1b324bcf28dfc65156 (diff)
Use the return value from getopt() instead of optopt in non-error
cases since optopt is not set in these cases, and it is not required by POSIX that it should be. ok millert otto
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/lpr/lpr/lpr.c8
-rw-r--r--usr.sbin/procmap/procmap.c4
2 files changed, 6 insertions, 6 deletions
diff --git a/usr.sbin/lpr/lpr/lpr.c b/usr.sbin/lpr/lpr/lpr.c
index db9b7e16160..09a7f5e8cba 100644
--- a/usr.sbin/lpr/lpr/lpr.c
+++ b/usr.sbin/lpr/lpr/lpr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lpr.c,v 1.36 2004/05/10 16:09:06 otto Exp $ */
+/* $OpenBSD: lpr.c,v 1.37 2005/03/25 16:54:17 jaredy Exp $ */
/* $NetBSD: lpr.c,v 1.19 2000/10/11 20:23:52 is Exp $ */
/*
@@ -46,7 +46,7 @@ static const char copyright[] =
#if 0
static const char sccsid[] = "@(#)lpr.c 8.4 (Berkeley) 4/28/95";
#else
-static const char rcsid[] = "$OpenBSD: lpr.c,v 1.36 2004/05/10 16:09:06 otto Exp $";
+static const char rcsid[] = "$OpenBSD: lpr.c,v 1.37 2005/03/25 16:54:17 jaredy Exp $";
#endif
#endif /* not lint */
@@ -169,7 +169,7 @@ main(int argc, char **argv)
case '3':
case '2':
case '1':
- fonts[optopt - '1'] = optarg;
+ fonts[ch - '1'] = optarg;
break;
case 'C': /* classification spec */
@@ -203,7 +203,7 @@ main(int argc, char **argv)
case 'p': /* print using ``pr'' */
case 't': /* print troff output (cat files) */
case 'v': /* print vplot output */
- format = optopt;
+ format = ch;
break;
case 'f': /* print fortran output */
diff --git a/usr.sbin/procmap/procmap.c b/usr.sbin/procmap/procmap.c
index a6266391789..3c199936552 100644
--- a/usr.sbin/procmap/procmap.c
+++ b/usr.sbin/procmap/procmap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: procmap.c,v 1.17 2004/07/09 19:30:52 tdeval Exp $ */
+/* $OpenBSD: procmap.c,v 1.18 2005/03/25 16:54:17 jaredy Exp $ */
/* $NetBSD: pmap.c,v 1.1 2002/09/01 20:32:44 atatat Exp $ */
/*
@@ -249,7 +249,7 @@ main(int argc, char *argv[])
break;
case 'r':
case 'x':
- errx(1, "-%c option not implemented, sorry", optopt);
+ errx(1, "-%c option not implemented, sorry", ch);
/*NOTREACHED*/
case '?':
default: