aboutsummaryrefslogtreecommitdiff
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
parentb509b608b5d22a06d618f011eaae0c4ab6c8e610 (diff)
Properly fix seg fault in powder_plot.c
(Correction to commit 7543dfc55966d)
-rw-r--r--libcrystfel/src/stream.c4
-rwxr-xr-xlibtool10
-rw-r--r--src/powder_plot.c8
3 files changed, 8 insertions, 14 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;
}
diff --git a/libtool b/libtool
index 77dfc244..10548d94 100755
--- a/libtool
+++ b/libtool
@@ -2,7 +2,7 @@
# libtool - Provide generalized library-building support services.
# Generated automatically by config.status (crystfel) 0.2.0
-# Libtool was configured on host psexport01:
+# Libtool was configured on host cfeld204tw.desy.de:
# NOTE: Changes made to this file will be lost: look at ltmain.sh.
#
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
@@ -93,7 +93,7 @@ NM="/usr/bin/nm -B"
LN_S="ln -s"
# What is the maximum length of a command?
-max_cmd_len=98304
+max_cmd_len=1572864
# Object file suffix (normally "o").
objext=o
@@ -237,10 +237,10 @@ finish_eval=""
hardcode_into_libs=yes
# Compile-time system search path for libraries.
-sys_lib_search_path_spec="/usr/lib/gcc/x86_64-redhat-linux/4.1.2 /usr/lib64 /lib64 "
+sys_lib_search_path_spec="/usr/lib/gcc/x86_64-redhat-linux/4.5.1 /usr/lib64 /lib64 "
# Run-time system search path for libraries.
-sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib /usr/lib64/mysql /usr/lib/qt-3.3/lib /usr/lib64/qt-3.3/lib /usr/local/lib64 /usr/local/lib /usr/lib/xulrunner-1.9.2 /usr/lib64/xulrunner-1.9.2 "
+sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib /usr/lib64/atlas /usr/local/cuda/lib64 /usr/local/cuda/lib /usr/lib64/tcl8.5 /usr/lib64/xulrunner-1.9.2 "
# Whether dlopen is supported.
dlopen_support=unknown
@@ -282,7 +282,7 @@ wl="-Wl,"
pic_flag=" -fPIC -DPIC"
# Compiler flag to prevent dynamic linking.
-link_static_flag="-static"
+link_static_flag=""
# Does compiler simultaneously support -c and -o options?
compiler_c_o="yes"
diff --git a/src/powder_plot.c b/src/powder_plot.c
index bb3ace9e..e9aaa49d 100644
--- a/src/powder_plot.c
+++ b/src/powder_plot.c
@@ -884,14 +884,6 @@ int main(int argc, char *argv[])
}
-
- /* 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;