From: Matthew Fernandez Date: Thu, 22 Jul 2021 02:05:12 +0000 (-0700) Subject: cluster: [nfc] remove mode argument to openFile X-Git-Tag: 2.49.0~41^2~13 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=879603e3394c12d4ed784072309d447788e55495;p=graphviz cluster: [nfc] remove mode argument to openFile This function is only ever called with mode "w". This is the equivalent of 21a6f2e2f7e8a377977c7bdad1356591a25d516f for cluster. --- 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;