diff options
author | Christian Neukirchen <chneukirchen@gmail.com> | 2015-05-01 01:29:18 +0200 |
---|---|---|
committer | Christian Neukirchen <chneukirchen@gmail.com> | 2015-05-01 01:29:18 +0200 |
commit | a958272d76178102b2f0666f53fac3359d1146bf (patch) | |
tree | 3372db02d7dca62feabb6dcf2a687b60878af1b6 /src/usr.bin/vis | |
parent | de8276e8aa55ee4c0fdafe0aa739af45fa0f8387 (diff) | |
download | outils-a958272d76178102b2f0666f53fac3359d1146bf.tar.gz outils-a958272d76178102b2f0666f53fac3359d1146bf.tar.xz outils-a958272d76178102b2f0666f53fac3359d1146bf.zip |
cvs update
Diffstat (limited to 'src/usr.bin/vis')
-rw-r--r-- | src/usr.bin/vis/vis.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/usr.bin/vis/vis.c b/src/usr.bin/vis/vis.c index b32ccef..fe40eed 100644 --- a/src/usr.bin/vis/vis.c +++ b/src/usr.bin/vis/vis.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vis.c,v 1.16 2015/02/08 23:40:34 deraadt Exp $ */ +/* $OpenBSD: vis.c,v 1.17 2015/04/18 18:28:38 deraadt Exp $ */ /* $NetBSD: vis.c,v 1.4 1994/12/20 16:13:03 jtc Exp $ */ /*- @@ -34,6 +34,7 @@ #include <string.h> #include <stdlib.h> #include <unistd.h> +#include <limits.h> #include <err.h> #include <vis.h> @@ -50,6 +51,7 @@ __dead void usage(void); int main(int argc, char *argv[]) { + const char *errstr; FILE *fp; int ch; @@ -80,10 +82,11 @@ main(int argc, char *argv[]) eflags |= VIS_NOSLASH; break; case 'F': - if ((foldwidth = atoi(optarg))<5) { + foldwidth = strtonum(optarg, 1, INT_MAX, &errstr); + if (errstr) + errx(1, "%s: %s", optarg, errstr); + if (foldwidth < 5) errx(1, "can't fold lines to less than 5 cols"); - /* NOTREACHED */ - } /*FALLTHROUGH*/ case 'f': fold = 1; /* fold output lines to 80 cols */ |