aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel
diff options
context:
space:
mode:
Diffstat (limited to 'libcrystfel')
-rw-r--r--libcrystfel/src/stream.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libcrystfel/src/stream.c b/libcrystfel/src/stream.c
index 118cd782..18e9eddc 100644
--- a/libcrystfel/src/stream.c
+++ b/libcrystfel/src/stream.c
@@ -1499,7 +1499,7 @@ void write_geometry_file(Stream *st, const char *geom_filename) {
do {
rval = fgets(line, 1023, geom_fh);
- fputs(line, st->fh);
+ if ( rval != NULL ) fputs(line, st->fh);
} while ( rval != NULL );
fclose(geom_fh);