diff options
author | Thomas White <taw@physics.org> | 2012-05-30 17:19:28 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2012-05-30 17:19:28 +0200 |
commit | 09eafd74841abb83e84fc56f22653525b9e25876 (patch) | |
tree | 3814181447e6006fbde4d15dca4d9b5e3c661f96 /libcrystfel/src/hdf5-file.c | |
parent | 4e0fe58f0d35f2a73f718917b2b99dc17fb9f7dd (diff) |
Fix previous commit
Diffstat (limited to 'libcrystfel/src/hdf5-file.c')
-rw-r--r-- | libcrystfel/src/hdf5-file.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/libcrystfel/src/hdf5-file.c b/libcrystfel/src/hdf5-file.c index 9924e665..af06c1b4 100644 --- a/libcrystfel/src/hdf5-file.c +++ b/libcrystfel/src/hdf5-file.c @@ -720,7 +720,8 @@ char *hdfile_get_string_value(struct hdfile *f, const char *name) hid_t type; hid_t class; herr_t r; - int buf; + int buf_i; + double buf_f; char *tmp; dh = H5Dopen2(f->fh, name, H5P_DEFAULT); @@ -768,11 +769,11 @@ char *hdfile_get_string_value(struct hdfile *f, const char *name) case H5T_FLOAT : r = H5Dread(dh, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, - H5P_DEFAULT, &buf); + H5P_DEFAULT, &buf_f); if ( r < 0 ) goto fail; tmp = malloc(256); - snprintf(tmp, 255, "%f", buf); + snprintf(tmp, 255, "%f", buf_f); return tmp; @@ -780,18 +781,17 @@ char *hdfile_get_string_value(struct hdfile *f, const char *name) r = H5Dread(dh, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, - H5P_DEFAULT, &buf); + H5P_DEFAULT, &buf_i); if ( r < 0 ) goto fail; tmp = malloc(256); - snprintf(tmp, 255, "%d", buf); + snprintf(tmp, 255, "%d", buf_i); return tmp; - } - default : { + default : goto fail; - } + } fail: |