diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/powder_plot.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/powder_plot.c b/src/powder_plot.c index d31ce59c..bb3ace9e 100644 --- a/src/powder_plot.c +++ b/src/powder_plot.c @@ -884,7 +884,15 @@ int main(int argc, char *argv[]) } - if ( is_stream(filename) ) { + + /* need to check that the file even exists before moving on */ + FILE * junk = fopen(filename,"r"); + if ( junk == NULL ) { + ERROR("The file %s does not exist!\n",filename); + exit(1); + } + + if ( is_stream(filename) == 1 ) { file_type = FILE_STREAM; fh = fopen(filename, "r"); |