aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel/src
diff options
context:
space:
mode:
authorRichard A. Kirian <rkirian@asu.edu>2011-12-02 09:49:47 -0800
committerThomas White <taw@physics.org>2012-02-22 15:27:42 +0100
commit05be0289256ba4bd1cce6039b7aae22caa4fc240 (patch)
tree6bcf4a7d03459625cf899099554af1a2298d8183 /libcrystfel/src
parentb509b608b5d22a06d618f011eaae0c4ab6c8e610 (diff)
Properly fix seg fault in powder_plot.c
(Correction to commit 7543dfc55966d)
Diffstat (limited to 'libcrystfel/src')
-rw-r--r--libcrystfel/src/stream.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libcrystfel/src/stream.c b/libcrystfel/src/stream.c
index a7cdc2d9..ce948109 100644
--- a/libcrystfel/src/stream.c
+++ b/libcrystfel/src/stream.c
@@ -472,6 +472,9 @@ int is_stream(const char *filename) {
char line[1024];
char *rval = NULL;
fh = fopen(filename, "r");
+ if ( fh == NULL ) {
+ return -1;
+ }
rval = fgets(line, 1023, fh);
fclose(fh);
if ( rval == NULL ) {
@@ -483,5 +486,4 @@ int is_stream(const char *filename) {
else {
return 0;
}
- return -1;
}