From bc19497f885ddb90499aaf7acbea570291cf237b Mon Sep 17 00:00:00 2001 From: cathugger Date: Thu, 31 May 2018 16:14:35 +0000 Subject: [PATCH] more tweaks --- main.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/main.c b/main.c index 6fc55b6..336ba8b 100644 --- a/main.c +++ b/main.c @@ -481,7 +481,7 @@ VEC_STRUCT(threadvec, pthread_t); int main(int argc,char **argv) { - char *outfile = 0; + const char *outfile = 0; const char *arg; int ignoreargs = 0; int dirnameflag = 0; @@ -622,7 +622,16 @@ int main(int argc,char **argv) if (numargit) goto nextarg; } - else filters_add(arg); + else + filters_add(arg); + } + + if (outfile) { + fout = fopen(outfile,"w"); + if (!fout) { + perror("failed to open output file"); + exit(Q_FAILOPENOUTPUT); + } } filters_prepare(); @@ -641,14 +650,6 @@ int main(int argc,char **argv) fprintf(stderr,"WARNING: -N switch will produce bogus results because we can't know filter width. reconfigure with --enable-besort and recompile.\n"); #endif - if (outfile) { - fout = fopen(outfile,"w"); - if (!fout) { - perror("failed to open output file"); - exit(Q_FAILOPENOUTPUT); - } - } - if (workdir) createdir(workdir,1);