diff options
author | Elena Pourmal <epourmal@hdfgroup.org> | 2008-05-06 19:23:32 (GMT) |
---|---|---|
committer | Elena Pourmal <epourmal@hdfgroup.org> | 2008-05-06 19:23:32 (GMT) |
commit | 0bfb17bf00b9d4dae00e7f454c437ca98f2a5677 (patch) | |
tree | 1d4ef1dd28b642ee28d27fd5fc579c5a10714538 /fortran/src/H5If.c | |
parent | 464e4619f670006c2477583b7f9d7b0530b0a245 (diff) | |
download | hdf5-0bfb17bf00b9d4dae00e7f454c437ca98f2a5677.zip hdf5-0bfb17bf00b9d4dae00e7f454c437ca98f2a5677.tar.gz hdf5-0bfb17bf00b9d4dae00e7f454c437ca98f2a5677.tar.bz2 |
[svn-r14942] Maintenance: Merged new Fortran APIs and tests from trunk into hdf5_1_8 branch
(used svn merge -r 14505:14941 http://svn.hdfgorup.uiuc.edu/hdf5/trunk/fortran
command).
Updated MANIFEST
Disabled -O3 optimization for gcc 4.3 (long due check-in)
Platforms tested: kagiso with PGI compilers, smirom with g95 and v16 option, linew
Diffstat (limited to 'fortran/src/H5If.c')
-rw-r--r-- | fortran/src/H5If.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/fortran/src/H5If.c b/fortran/src/H5If.c index d948259..b4c7660 100644 --- a/fortran/src/H5If.c +++ b/fortran/src/H5If.c @@ -54,7 +54,11 @@ nh5iget_type_c (hid_t_f *obj_id, int_f *type) * Returns: length of the name on success, -1 on failure * Programmer: Elena Pourmal * Wednesday, March 12, 2003 - * Modifications: + * Modifications: + * Changed the size of c_buf_size to c_buf_size + 1, which + * fixes the problem of truncating the string by 1 if the + * exact size of the string (buf_size) is passed in. + * M.S. Breitenfeld, April 21, 2008 *---------------------------------------------------------------------------*/ int_f nh5iget_name_c(hid_t_f *obj_id, _fcd buf, size_t_f *buf_size, size_t_f *name_size) @@ -68,8 +72,8 @@ nh5iget_name_c(hid_t_f *obj_id, _fcd buf, size_t_f *buf_size, size_t_f *name_siz /* * Allocate buffer to hold name of an attribute */ - c_buf_size = (size_t)*buf_size; - c_buf = (char *)HDmalloc(c_buf_size +1); + c_buf_size = (size_t)*buf_size +1; + c_buf = (char *)HDmalloc(c_buf_size); if (c_buf == NULL) return ret_value; /* @@ -82,7 +86,7 @@ nh5iget_name_c(hid_t_f *obj_id, _fcd buf, size_t_f *buf_size, size_t_f *name_siz /* * Convert C name to FORTRAN and place it in the given buffer */ - HD5packFstring(c_buf, _fcdtocp(buf), c_buf_size); + HD5packFstring(c_buf, _fcdtocp(buf), c_buf_size-1); *name_size = (size_t_f)c_size; ret_value = 0; |