diff options
author | Leah Neukirchen <leah@vuxu.org> | 2018-07-19 19:07:48 +0200 |
---|---|---|
committer | Leah Neukirchen <leah@vuxu.org> | 2018-07-19 19:07:48 +0200 |
commit | 1e8d516b02f4370b8b69de9fd4259077e94de5a1 (patch) | |
tree | cc1562d3debf32faac6c03bfd16c6a722f3175a1 | |
parent | 0e384ca6517b0f571f1016498dd69c53f34e686f (diff) | |
download | outils-1e8d516b02f4370b8b69de9fd4259077e94de5a1.tar.gz outils-1e8d516b02f4370b8b69de9fd4259077e94de5a1.tar.xz outils-1e8d516b02f4370b8b69de9fd4259077e94de5a1.zip |
cvs update
-rw-r--r-- | src/usr.bin/lam/lam.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/usr.bin/lam/lam.c b/src/usr.bin/lam/lam.c index ecc1d4a..0554393 100644 --- a/src/usr.bin/lam/lam.c +++ b/src/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.21 2018/07/11 11:42:17 schwarze Exp $ */ /* $NetBSD: lam.c,v 1.2 1994/11/14 20:27:42 jtc Exp $ */ /*- @@ -78,6 +78,10 @@ main(int argc, char *argv[]) getargs(argc, argv); if (numfiles == 0) usage(); + + if (pledge("stdio", NULL) == -1) + err(1, "pledge"); + /* Concatenate lines from each file, then print. */ for (;;) { linep = line; @@ -109,6 +113,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 +132,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; |