diff options
author | Thomas White <taw@physics.org> | 2009-12-04 16:48:05 +0100 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2009-12-04 16:48:05 +0100 |
commit | b7741b3c35045c1d1d4b0cab3aa2c2b9157247e4 (patch) | |
tree | 68e0503237a8fe0415428df0226051e94e5a93e0 /src/reflections.c | |
parent | 550acac3992f5b5aa2d162ed215ddd3359588450 (diff) |
Add -o option, fix noise option
Diffstat (limited to 'src/reflections.c')
-rw-r--r-- | src/reflections.c | 11 |
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 ) { |