aboutsummaryrefslogtreecommitdiff
path: root/src/reflections.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/reflections.c')
-rw-r--r--src/reflections.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/reflections.c b/src/reflections.c
index 5790b543..26a5d2b8 100644
--- a/src/reflections.c
+++ b/src/reflections.c
@@ -27,7 +27,16 @@ void write_reflections(const char *filename, unsigned int *counts,
FILE *fh;
signed int h, k, l;
- fh = fopen(filename, "w");
+ if ( filename == NULL ) {
+ fh = stdout;
+ } else {
+ fh = fopen(filename, "w");
+ }
+
+ if ( fh == NULL ) {
+ ERROR("Couldn't open output file!\n");
+ return;
+ }
/* Write spacings and angle if zone axis pattern */
if ( zone_axis ) {