aboutsummaryrefslogtreecommitdiff
path: root/src/exchange-tools
diff options
context:
space:
mode:
Diffstat (limited to 'src/exchange-tools')
-rw-r--r--src/exchange-tools/taler-exchange-wire.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/exchange-tools/taler-exchange-wire.c b/src/exchange-tools/taler-exchange-wire.c
index 81f292a1d..c84c0b693 100644
--- a/src/exchange-tools/taler-exchange-wire.c
+++ b/src/exchange-tools/taler-exchange-wire.c
@@ -177,9 +177,18 @@ run (void *cls,
if (NULL != output_filename)
{
- fclose (stdout);
+ if (NULL != stdout)
+ fclose (stdout);
stdout = fopen (output_filename,
"w+");
+ if (NULL == stdout)
+ {
+ fprintf (stderr,
+ "Failed to open `%s': %s\n",
+ output_filename,
+ STRERROR (errno));
+ return;
+ }
}
fprintf (stdout,
"%s",