From 879603e3394c12d4ed784072309d447788e55495 Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Wed, 21 Jul 2021 19:05:12 -0700 Subject: [PATCH] cluster: [nfc] remove mode argument to openFile This function is only ever called with mode "w". This is the equivalent of 21a6f2e2f7e8a377977c7bdad1356591a25d516f for cluster. --- cmd/gvmap/cluster.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/cmd/gvmap/cluster.c b/cmd/gvmap/cluster.c index 26f6e3c76..dd1f519f9 100644 --- a/cmd/gvmap/cluster.c +++ b/cmd/gvmap/cluster.c @@ -64,19 +64,13 @@ static void usage(char* cmd, int eval) exit(eval); } -static FILE *openFile(const char *name, const char *mode, const char* cmd) +static FILE *openFile(const char *name, const char* cmd) { FILE *fp; - char *modestr; - fp = fopen(name, mode); + fp = fopen(name, "w"); if (!fp) { - if (*mode == 'r') - modestr = "reading"; - else - modestr = "writing"; - fprintf(stderr, "%s: could not open file %s for %s\n", - cmd, name, modestr); + fprintf(stderr, "%s: could not open file %s for writing\n", cmd, name); exit(-1); } return fp; @@ -107,7 +101,7 @@ static void init(int argc, char *argv[], opts_t* opts) { else opts->maxcluster = v; break; case 'o': - opts->outfp = openFile(optarg, "w", cmd); + opts->outfp = openFile(optarg, cmd); break; case 'v': Verbose = 1; -- 2.40.0