summaryrefslogtreecommitdiff
path: root/usr.bin/lam
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2018-07-11 11:35:07 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2018-07-11 11:35:07 +0000
commitb47b6cbdb81a00ec623fb283d9f60e3fca9d2506 (patch)
treec3a6bf85338648e4fa982f77d2515bc0ff205f5a /usr.bin/lam
parentb71969164738bd43d5acdf3bcaeed662a52934a3 (diff)
Repair the regression introduced by the recent refactoring
revision 1.11 date: 2004/07/03 21:00:37; for -p/-P, the argument was no longer parsed, causing segfaults. OK millert@
Diffstat (limited to 'usr.bin/lam')
-rw-r--r--usr.bin/lam/lam.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/usr.bin/lam/lam.c b/usr.bin/lam/lam.c
index a2a70e9747c..c7bac5bd7cd 100644
--- a/usr.bin/lam/lam.c
+++ b/usr.bin/lam/lam.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lam.c,v 1.19 2015/10/09 01:37:08 deraadt Exp $ */
+/* $OpenBSD: lam.c,v 1.20 2018/07/11 11:35:06 schwarze Exp $ */
/* $NetBSD: lam.c,v 1.2 1994/11/14 20:27:42 jtc Exp $ */
/*-
@@ -109,6 +109,10 @@ getargs(int argc, char *argv[])
P = S = F = T = 0; /* capitalized options */
while (optind < argc) {
switch (ch = getopt(argc, argv, "F:f:P:p:S:s:T:t:")) {
+ case 'P': case 'p':
+ P = (ch == 'P');
+ ip->pad = 1;
+ /* FALLTHROUGH */
case 'F': case 'f':
F = (ch == 'F');
/* Validate format string argument. */
@@ -124,10 +128,6 @@ getargs(int argc, char *argv[])
snprintf(p, siz, "%%%ss", optarg);
ip->format = p;
break;
- case 'P': case 'p':
- P = (ch == 'P');
- ip->pad = 1;
- break;
case 'S': case 's':
S = (ch == 'S');
ip->sepstring = optarg;