diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2005-01-19 02:51:12 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2005-01-19 02:51:12 (GMT) |
commit | fabb06712b15f111c7ccce8c394ff6fc9bd2f997 (patch) | |
tree | 51b5f57598d1ff355090e481a8268ee5ba80e88c /fortran/src/H5Ef.c | |
parent | b8f7cdc48d9c8470fdf8930938e75b50210150fb (diff) | |
download | hdf5-fabb06712b15f111c7ccce8c394ff6fc9bd2f997.zip hdf5-fabb06712b15f111c7ccce8c394ff6fc9bd2f997.tar.gz hdf5-fabb06712b15f111c7ccce8c394ff6fc9bd2f997.tar.bz2 |
[svn-r9838] Purpose:
Bug fix
Description:
Correctly retire the H5E_LEN setting, now that the FORTRAN and C++ APIs
have been corrected to not use it either.
Solution:
Pass in the string buffer length for FORTRAN
In the C++ API, call H5Eget_msg() in a manner similar to the way
H5Fget_name() is called.
Platforms tested:
Linux 2.4 (heping) w/FORTRAN & C++
Solaris 2.7 (arabica) w/FORTRAN & C++
Diffstat (limited to 'fortran/src/H5Ef.c')
-rw-r--r-- | fortran/src/H5Ef.c | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/fortran/src/H5Ef.c b/fortran/src/H5Ef.c index 3921ebf..6bd6d74 100644 --- a/fortran/src/H5Ef.c +++ b/fortran/src/H5Ef.c @@ -118,18 +118,22 @@ nh5eprint_c2() * Modifications: *---------------------------------------------------------------------------*/ int_f -nh5eget_major_c(int_f* error_no, _fcd name) +nh5eget_major_c(int_f* error_no, _fcd name, size_t_f* namelen) { int ret_val = -1; - char c_name[H5E_LEN]; + char *c_name; + size_t c_namelen; hid_t c_error_no; c_error_no = (hid_t)*error_no; + c_namelen = (size_t)*namelen; + if(c_namelen) c_name = (char*) HDmalloc(c_namelen + 1); + /* * Call H5Eget_major function. */ - H5Eget_msg(c_error_no, NULL, c_name, H5E_LEN); - HD5packFstring((char*)c_name, _fcdtocp(name), strlen(c_name)); + H5Eget_msg(c_error_no, NULL, c_name, c_namelen); + HD5packFstring((char*)c_name, _fcdtocp(name), c_namelen); if(!strcmp(c_name, "Invalid major error number")) return ret_val; ret_val = 0; @@ -148,18 +152,22 @@ nh5eget_major_c(int_f* error_no, _fcd name) * Modifications: *---------------------------------------------------------------------------*/ int_f -nh5eget_minor_c(int_f* error_no, _fcd name) +nh5eget_minor_c(int_f* error_no, _fcd name, size_t_f* namelen) { int ret_val = -1; - char c_name[H5E_LEN]; + char *c_name; + size_t c_namelen; hid_t c_error_no; c_error_no = (hid_t)*error_no; + c_namelen = (size_t)*namelen; + if(c_namelen) c_name = (char*) HDmalloc(c_namelen + 1); + /* * Call H5Eget_minor function. */ - H5Eget_msg(c_error_no, NULL, c_name, H5E_LEN); - HD5packFstring((char*)c_name, _fcdtocp(name), strlen(c_name)); + H5Eget_msg(c_error_no, NULL, c_name, c_namelen); + HD5packFstring((char*)c_name, _fcdtocp(name), c_namelen); if(!strcmp(c_name, "Invalid minor error number")) return ret_val; ret_val = 0; |