From 359991c00513923d84a00a0577f385098e0ca50a Mon Sep 17 00:00:00 2001 From: Virgil Dupras Date: Tue, 31 Dec 2019 15:12:17 -0500 Subject: [PATCH] cfspack: fix compilation error Some compilers don't like assigning stdout statically. --- tools/cfspack/libcfs.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/cfspack/libcfs.c b/tools/cfspack/libcfs.c index 746619c..586b20c 100644 --- a/tools/cfspack/libcfs.c +++ b/tools/cfspack/libcfs.c @@ -11,7 +11,7 @@ #define PUTC(c) putc(c, spitstream) -static FILE *spitstream = stdout; +static FILE *spitstream = NULL; void set_spit_stream(FILE *stream) { @@ -27,6 +27,7 @@ int is_regular_file(char *path) void spitempty() { + if (spitstream == NULL) spitstream = stdout; PUTC('C'); PUTC('F'); PUTC('S'); @@ -37,6 +38,7 @@ void spitempty() int spitblock(char *fullpath, char *fn) { + if (spitstream == NULL) spitstream = stdout; FILE *fp = fopen(fullpath, "r"); fseek(fp, 0, SEEK_END); long fsize = ftell(fp);