summaryrefslogtreecommitdiffstats
path: root/src/H5FDfamily.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2007-02-27 17:48:57 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2007-02-27 17:48:57 (GMT)
commit6b12e9769f8e246d9abd8ed62a6d4fd8526b9fa5 (patch)
treed6eea7ca0c6a3ab8bac7c63d2c66c68fbf91c834 /src/H5FDfamily.c
parentb94776f418e602251eb96bf58ee930380a2173e8 (diff)
downloadhdf5-6b12e9769f8e246d9abd8ed62a6d4fd8526b9fa5.zip
hdf5-6b12e9769f8e246d9abd8ed62a6d4fd8526b9fa5.tar.gz
hdf5-6b12e9769f8e246d9abd8ed62a6d4fd8526b9fa5.tar.bz2
[svn-r13419] Description:
Fix error introduced into driver info block size computation, which caused the test/big test to fail. Tested on: Linux/32 2.6 (chicago) Linux/64 2.6 (chicago2)
Diffstat (limited to 'src/H5FDfamily.c')
-rw-r--r--src/H5FDfamily.c38
1 files changed, 16 insertions, 22 deletions
diff --git a/src/H5FDfamily.c b/src/H5FDfamily.c
index 88abab3..34360e5 100644
--- a/src/H5FDfamily.c
+++ b/src/H5FDfamily.c
@@ -613,27 +613,21 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5FD_family_sb_encode(H5FD_t *_file, char *name/*out*/,
- unsigned char *buf/*out*/)
+H5FD_family_sb_encode(H5FD_t *_file, char *name/*out*/, unsigned char *buf/*out*/)
{
H5FD_family_t *file = (H5FD_family_t*)_file;
- unsigned char *p = buf;
- uint64_t msize;
- herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(H5FD_family_sb_encode, FAIL)
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FD_family_sb_encode)
/* Name and version number */
- strncpy(name, "NCSAfami", (size_t)8);
+ HDstrncpy(name, "NCSAfami", (size_t)8);
name[8] = '\0';
- /* copy member file size */
- msize = (uint64_t)file->memb_size;
- UINT64ENCODE(p, msize);
+ /* Store member file size */
+ UINT64ENCODE(buf, (uint64_t)file->memb_size);
-done:
- FUNC_LEAVE_NOAPI(ret_value)
-}
+ FUNC_LEAVE_NOAPI(SUCCEED)
+} /* end H5FD_family_sb_encode() */
/*-------------------------------------------------------------------------
@@ -660,9 +654,8 @@ static herr_t
H5FD_family_sb_decode(H5FD_t *_file, const char UNUSED *name, const unsigned char *buf)
{
H5FD_family_t *file = (H5FD_family_t*)_file;
- uint64_t msize = 0;
- char err_msg[128];
- herr_t ret_value=SUCCEED; /* Return value */
+ uint64_t msize;
+ herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(H5FD_family_sb_decode, FAIL)
@@ -676,18 +669,19 @@ H5FD_family_sb_decode(H5FD_t *_file, const char UNUSED *name, const unsigned cha
if(file->mem_newsize) {
file->memb_size = file->mem_newsize;
HGOTO_DONE(ret_value)
- }
+ } /* end if */
/* Default - use the saved member size */
- if(file->pmem_size == H5F_FAMILY_DEFAULT) {
+ if(file->pmem_size == H5F_FAMILY_DEFAULT)
file->pmem_size = msize;
- }
/* Check if member size from file access property is correct */
if(msize != file->pmem_size) {
- sprintf(err_msg, "family member size should be %lu", (unsigned long)msize);
+ char err_msg[128];
+
+ sprintf(err_msg, "family member size should be %lu, is %lu", (unsigned long)msize, (unsigned long)file->pmem_size);
HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, err_msg)
- }
+ } /* end if */
/* Update member file size to the size saved in the superblock.
* That's the size intended to be. */
@@ -695,7 +689,7 @@ H5FD_family_sb_decode(H5FD_t *_file, const char UNUSED *name, const unsigned cha
done:
FUNC_LEAVE_NOAPI(ret_value)
-}
+} /* end H5FD_family_sb_decode() */
/*-------------------------------------------------------------------------