summaryrefslogtreecommitdiffstats
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
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.
-rw-r--r--src/H5Tconv.c7
-rw-r--r--test/tvlstr.c2
2 files changed, 4 insertions, 5 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)
diff --git a/test/tvlstr.c b/test/tvlstr.c
index a7b2a32..e41da26 100644
--- a/test/tvlstr.c
+++ b/test/tvlstr.c
@@ -256,7 +256,7 @@ test_vlstrings_basic(void)
static void
test_vlstrings_special(void)
{
- const char *wdata[SPACE1_DIM1] = {"one", "two", "", "\0"};
+ const char *wdata[SPACE1_DIM1] = {"", "two", "three", "\0"};
const char *wdata2[SPACE1_DIM1] = {NULL, NULL, NULL, NULL};
char *rdata[SPACE1_DIM1]; /* Information read in */
char *fill; /* Fill value */