summaryrefslogtreecommitdiffstats
path: root/main.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2009-06-27 09:03:03 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2009-06-27 09:03:03 +0000
commitd4911e32db795a6549559dd6175abf1f7dc21bc1 (patch)
tree92c106df57f04d37819bd906341c606797c494c5 /main.c
parentad225a6a2b6bfdf877e313273105ffa4a27043a0 (diff)
downloadmandoc-d4911e32db795a6549559dd6175abf1f7dc21bc1.tar.gz
Removed escape-deprecation note (better solution in progress, schwarze@openbsd.org).
Using EXIT_FAILURE for parse errors (nicm@openbsd.org). Fixed use of warn/warnx (nicm@openbsd.org). Fixed use of getsubopt (nicm@openbsd.org).
Diffstat (limited to 'main.c')
-rw-r--r--main.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/main.c b/main.c
index dd7df9fe..3f6edeb8 100644
--- a/main.c
+++ b/main.c
@@ -132,19 +132,19 @@ main(int argc, char *argv[])
switch (c) {
case ('f'):
if ( ! foptions(&curp.fflags, optarg))
- return(0);
+ return(EXIT_FAILURE);
break;
case ('m'):
if ( ! moptions(&curp.inttype, optarg))
- return(0);
+ return(EXIT_FAILURE);
break;
case ('T'):
if ( ! toptions(&curp.outtype, optarg))
- return(0);
+ return(EXIT_FAILURE);
break;
case ('W'):
if ( ! woptions(&curp.wflags, optarg))
- return(0);
+ return(EXIT_FAILURE);
break;
case ('V'):
version();
@@ -318,7 +318,7 @@ fdesc(struct buf *blk, struct buf *ln, struct curparse *curp)
*/
if (-1 == fstat(curp->fd, &st))
- warnx("%s", curp->file);
+ warn("%s", curp->file);
else if ((size_t)st.st_blksize > sz)
sz = st.st_blksize;
@@ -581,7 +581,7 @@ foptions(int *fflags, char *arg)
NO_IGN_MACRO | NO_IGN_CHARS;
break;
default:
- warnx("bad argument: -f%s", arg);
+ warnx("bad argument: -f%s", suboptarg);
return(0);
}
@@ -616,7 +616,7 @@ woptions(int *wflags, char *arg)
*wflags |= WARN_WERR;
break;
default:
- warnx("bad argument: -W%s", arg);
+ warnx("bad argument: -W%s", suboptarg);
return(0);
}