summaryrefslogtreecommitdiffstats
path: root/fortran/src/H5Ef.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2010-03-25 03:51:41 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2010-03-25 03:51:41 (GMT)
commit42efc1c2b591e4cd45ec6cb3bdf32044343118d2 (patch)
tree0ab542871c32246199479e8933ff26286aaf629a /fortran/src/H5Ef.c
parent3360c3af0c100ac4d3a2fe2865f34661da862ec5 (diff)
downloadhdf5-42efc1c2b591e4cd45ec6cb3bdf32044343118d2.zip
hdf5-42efc1c2b591e4cd45ec6cb3bdf32044343118d2.tar.gz
hdf5-42efc1c2b591e4cd45ec6cb3bdf32044343118d2.tar.bz2
[svn-r18451] Description:
Bring r18172:18446 from trunk to revise_chunks branch. Tested on: FreeBSD/32 6.3 (duty) in debug mode FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x, w/C++ & FORTRAN, w/threadsafe, in debug mode Linux/64-amd64 2.6 (amani) w/Intel compilers, w/default API=1.6.x, w/C++ & FORTRAN, in production mode Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN, w/szip filter, in production mode Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN, in production mode Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Diffstat (limited to 'fortran/src/H5Ef.c')
-rw-r--r--fortran/src/H5Ef.c30
1 files changed, 16 insertions, 14 deletions
diff --git a/fortran/src/H5Ef.c b/fortran/src/H5Ef.c
index 4f9d652..c6d860c 100644
--- a/fortran/src/H5Ef.c
+++ b/fortran/src/H5Ef.c
@@ -62,7 +62,7 @@ nh5eprint_c1(_fcd name, int_f* namelen)
FILE *file = NULL;
char *c_name = NULL;
int_f ret_value = 0;
-
+
if(NULL == (c_name = (char*)HD5f2cstring(name, (size_t)*namelen)))
HGOTO_DONE(FAIL)
if(NULL == (file = HDfopen(c_name, "a")))
@@ -128,19 +128,20 @@ nh5eget_major_c(int_f* error_no, _fcd name, size_t_f* namelen)
size_t c_namelen = (size_t)*namelen;
int_f ret_value = 0;
- if(c_namelen) {
- if(NULL == (c_name = (char *)HDmalloc(c_namelen + 1)))
- HGOTO_DONE(FAIL)
- } /* end if */
+ if(c_namelen > 0)
+ c_name = (char *)HDmalloc(c_namelen + 1);
+
+ if(!c_name)
+ HGOTO_DONE(FAIL)
/*
* Call H5Eget_major function.
*/
H5Eget_msg((hid_t)*error_no, NULL, c_name, c_namelen);
HD5packFstring((char*)c_name, _fcdtocp(name), c_namelen);
- if(!HDstrcmp(c_name, "Invalid major error number"))
+ if(!HDstrcmp(c_name, "Invalid major error number"))
HGOTO_DONE(FAIL)
-
+
done:
if(c_name)
HDfree(c_name);
@@ -166,23 +167,24 @@ nh5eget_minor_c(int_f* error_no, _fcd name, size_t_f* namelen)
size_t c_namelen = (size_t)*namelen;
int_f ret_value = 0;
- if(c_namelen) {
- if(NULL == (c_name = (char *)HDmalloc(c_namelen + 1)))
- HGOTO_DONE(FAIL)
- } /* end if */
+ if(c_namelen > 0)
+ c_name = (char *)HDmalloc(c_namelen + 1);
+
+ if(!c_name)
+ HGOTO_DONE(FAIL)
/*
* Call H5Eget_minor function.
*/
H5Eget_msg((hid_t)*error_no, NULL, c_name, c_namelen);
HD5packFstring((char *)c_name, _fcdtocp(name), c_namelen);
- if(!HDstrcmp(c_name, "Invalid minor error number"))
+ if(!HDstrcmp(c_name, "Invalid minor error number"))
HGOTO_DONE(FAIL)
-
+
done:
if(c_name)
HDfree(c_name);
-
+
return ret_value;
}