=================================================================== RCS file: /cvs/mandoc/main.c,v retrieving revision 1.47 retrieving revision 1.49 diff -u -p -r1.47 -r1.49 --- mandoc/main.c 2009/10/26 04:15:42 1.47 +++ mandoc/main.c 2009/10/26 08:42:37 1.49 @@ -1,4 +1,4 @@ -/* $Id: main.c,v 1.47 2009/10/26 04:15:42 kristaps Exp $ */ +/* $Id: main.c,v 1.49 2009/10/26 08:42:37 kristaps Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons * @@ -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 *); @@ -134,8 +135,9 @@ main(int argc, char *argv[]) if ( ! moptions(&curp.inttype, optarg)) return(EXIT_FAILURE); break; - case ('o'): - curp.outopts = optarg; + case ('O'): + (void)strlcat(curp.outopts, optarg, BUFSIZ); + (void)strlcat(curp.outopts, ",", BUFSIZ); break; case ('T'): if ( ! toptions(&curp.outtype, optarg)) @@ -221,8 +223,8 @@ usage(void) { (void)fprintf(stderr, "usage: %s [-V] [-foption...] " - "[-mformat] [-Toutput] [-Werr...]\n", - __progname); + "[-mformat] [-Ooption] [-Toutput] " + "[-Werr...]\n", __progname); exit(EXIT_FAILURE); }