diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2009-10-26 08:42:37 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2009-10-26 08:42:37 +0000 |
commit | 1fe981dc5f7f8713b09d7b5261990131ed6ff843 (patch) | |
tree | 529fa03854ec11174a7ffa9b3f29c75b8fd4de72 /main.c | |
parent | 03ddeec98e2d42a4ed7f64e0773bfab105475220 (diff) | |
download | mandoc-1fe981dc5f7f8713b09d7b5261990131ed6ff843.tar.gz |
Allowed -O to be invoked multiple times.
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -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)) |