summaryrefslogtreecommitdiffstats
path: root/hl/test/test_ds.c
diff options
context:
space:
mode:
authorScot Breitenfeld <brtnfld@hdfgroup.org>2013-02-11 02:06:01 (GMT)
committerScot Breitenfeld <brtnfld@hdfgroup.org>2013-02-11 02:06:01 (GMT)
commit871b69723e764114578c2c88f125d8ce6ce57597 (patch)
tree8db4347ca7b4c49d7492f4a5e5fd1f5cba4c8857 /hl/test/test_ds.c
parent944f0399ac73a622dcfb03c42dbfad4ecc2948ed (diff)
downloadhdf5-871b69723e764114578c2c88f125d8ce6ce57597.zip
hdf5-871b69723e764114578c2c88f125d8ce6ce57597.tar.gz
hdf5-871b69723e764114578c2c88f125d8ce6ce57597.tar.bz2
[svn-r23241] Fix for: HDFFV-7596 H5DSget_scale returns size that includes NULL termination and H5DSget_label returns size
Updated tests. Tested: jam( gnu, intel)
Diffstat (limited to 'hl/test/test_ds.c')
-rw-r--r--hl/test/test_ds.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/hl/test/test_ds.c b/hl/test/test_ds.c
index e290bbb..b81f8d4 100644
--- a/hl/test/test_ds.c
+++ b/hl/test/test_ds.c
@@ -1127,9 +1127,9 @@ herr_t test_cmp_scalename(hid_t fid, hid_t did, const char *name, const char *sc
if((dsid = H5Dopen2(fid, name, H5P_DEFAULT)) >= 0) {
if(H5DSis_attached(did, dsid, idx) == 1) {
if((name_len=H5DSget_scale_name(dsid,NULL,(size_t)0)) > 0) {
- name_out = (char*)HDmalloc(name_len * sizeof (char));
+ name_out = (char*)HDmalloc((name_len+1) * sizeof (char));
if(name_out != NULL) {
- if(H5DSget_scale_name(dsid, name_out, (size_t)name_len) >= 0) {
+ if(H5DSget_scale_name(dsid, name_out, (size_t)name_len+1) >= 0) {
if(HDstrcmp(scalename,name_out)==0) {
ret_value = SUCCEED;
}
@@ -3232,12 +3232,12 @@ static int test_simple(void)
goto out;
/* allocate a buffer */
- name_out = (char*)HDmalloc(name_len * sizeof (char));
+ name_out = (char*)HDmalloc((name_len+1) * sizeof (char));
if(name_out == NULL)
goto out;
/* get the scale name using this buffer */
- if(H5DSget_scale_name(dsid, name_out, (size_t)name_len) < 0)
+ if(H5DSget_scale_name(dsid, name_out, (size_t)name_len+1) < 0)
goto out;
if(HDstrcmp("Latitude set 0",name_out)!=0)