summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRaymond Lu <songyulu@hdfgroup.org>2007-03-26 21:18:13 (GMT)
committerRaymond Lu <songyulu@hdfgroup.org>2007-03-26 21:18:13 (GMT)
commitdde381add4e4bd4e03812ce8a5b678185d6296b7 (patch)
tree78e52ee5263da4272dd9e7a327d3c22965d5835b /src
parent4eed634bcf57fc1253f77bea2256d407db098d51 (diff)
downloadhdf5-dde381add4e4bd4e03812ce8a5b678185d6296b7.zip
hdf5-dde381add4e4bd4e03812ce8a5b678185d6296b7.tar.gz
hdf5-dde381add4e4bd4e03812ce8a5b678185d6296b7.tar.bz2
[svn-r13544] Some minor adjustment from last round of checkin. Tested on kagiso
only because the changes are simple.
Diffstat (limited to 'src')
-rw-r--r--src/H5Tconv.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/H5Tconv.c b/src/H5Tconv.c
index 534820b..3a94bb2 100644
--- a/src/H5Tconv.c
+++ b/src/H5Tconv.c
@@ -2838,13 +2838,12 @@ H5T_conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
/* Check if conversion buffer is large enough, resize if
* necessary. If the SEQ_LEN is 0, allocate a minimal size buffer. */
- if(src_size==0 && dst_size==0) {
+ if(!seq_len && !conv_buf) {
conv_buf_size=((1/H5T_VLEN_MIN_CONF_BUF_SIZE)+1)*H5T_VLEN_MIN_CONF_BUF_SIZE;
- if((conv_buf=H5FL_BLK_REALLOC(vlen_seq,conv_buf, conv_buf_size))==NULL)
+ if((conv_buf=H5FL_BLK_MALLOC(vlen_seq,conv_buf_size))==NULL)
HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for type conversion");
}
-
- if(conv_buf_size<MAX(src_size,dst_size)) {
+ else if(conv_buf_size<MAX(src_size,dst_size)) {
/* Only allocate conversion buffer in H5T_VLEN_MIN_CONF_BUF_SIZE increments */
conv_buf_size=((MAX(src_size,dst_size)/H5T_VLEN_MIN_CONF_BUF_SIZE)+1)*H5T_VLEN_MIN_CONF_BUF_SIZE;
if((conv_buf=H5FL_BLK_REALLOC(vlen_seq,conv_buf, conv_buf_size))==NULL)