summaryrefslogtreecommitdiffstats
path: root/main.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2009-10-26 08:42:37 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2009-10-26 08:42:37 +0000
commit1fe981dc5f7f8713b09d7b5261990131ed6ff843 (patch)
tree529fa03854ec11174a7ffa9b3f29c75b8fd4de72 /main.c
parent03ddeec98e2d42a4ed7f64e0773bfab105475220 (diff)
downloadmandoc-1fe981dc5f7f8713b09d7b5261990131ed6ff843.tar.gz
Allowed -O to be invoked multiple times.
Diffstat (limited to 'main.c')
-rw-r--r--main.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/main.c b/main.c
index 1663e8be..9161bb5a 100644
--- a/main.c
+++ b/main.c
@@ -35,6 +35,7 @@
#ifdef __linux__
extern int getsubopt(char **, char * const *, char **);
+extern size_t strlcat(char *, const char *, size_t);
# ifndef __dead
# define __dead __attribute__((__noreturn__))
# endif
@@ -88,7 +89,7 @@ struct curparse {
out_man outman;
out_free outfree;
void *outdata;
- char *outopts;
+ char outopts[BUFSIZ];
};
static int foptions(int *, char *);
@@ -135,7 +136,8 @@ main(int argc, char *argv[])
return(EXIT_FAILURE);
break;
case ('O'):
- curp.outopts = optarg;
+ (void)strlcat(curp.outopts, optarg, BUFSIZ);
+ (void)strlcat(curp.outopts, ",", BUFSIZ);
break;
case ('T'):
if ( ! toptions(&curp.outtype, optarg))