From 4f1d8b29bbb62b7a8ceff4c228935dba0cdf340c Mon Sep 17 00:00:00 2001 From: Kristaps Dzonsons Date: Mon, 26 Oct 2009 08:42:37 +0000 Subject: Allowed -O to be invoked multiple times. --- main.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'main.c') diff --git a/main.c b/main.c index c325066b..dabfd625 100644 --- a/main.c +++ b/main.c @@ -1,4 +1,4 @@ -/* $Id: main.c,v 1.48 2009/10/26 08:18:16 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 *); @@ -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)) -- cgit v1.2.3