summaryrefslogtreecommitdiffstats
path: root/hl
diff options
context:
space:
mode:
authorScot Breitenfeld <brtnfld@hdfgroup.org>2014-10-01 01:58:09 (GMT)
committerScot Breitenfeld <brtnfld@hdfgroup.org>2014-10-01 01:58:09 (GMT)
commitf1e70ac474a88f68acb6620a96bef738ec5dcd3c (patch)
tree513bbf503b193b5de488afebb789597736afff3c /hl
parentf2535031952d9c848538043829d43108575cdce3 (diff)
downloadhdf5-f1e70ac474a88f68acb6620a96bef738ec5dcd3c.zip
hdf5-f1e70ac474a88f68acb6620a96bef738ec5dcd3c.tar.gz
hdf5-f1e70ac474a88f68acb6620a96bef738ec5dcd3c.tar.bz2
[svn-r25643] merged change 23241 into the branch.
Diffstat (limited to 'hl')
-rw-r--r--hl/src/H5DS.c2
-rw-r--r--hl/test/test_ds.c6
2 files changed, 4 insertions, 4 deletions
diff --git a/hl/src/H5DS.c b/hl/src/H5DS.c
index 1f0f678..df69380 100644
--- a/hl/src/H5DS.c
+++ b/hl/src/H5DS.c
@@ -1880,7 +1880,7 @@ ssize_t H5DSget_scale_name(hid_t did,
if (buf)
HDfree(buf);
- return (ssize_t)(nbytes - 1);
+ return (ssize_t) MAX(0,nbytes-1);
/* error zone */
out:
diff --git a/hl/test/test_ds.c b/hl/test/test_ds.c
index 2d998f6..d071fd5 100644
--- a/hl/test/test_ds.c
+++ b/hl/test/test_ds.c
@@ -1105,10 +1105,10 @@ 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(((size_t)name_len+1) * 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+1) >= 0) {
- if(HDstrncmp(scalename, name_out, (size_t)name_len)==0) {
+ if(HDstrcmp(scalename,name_out)==0) {
ret_value = SUCCEED;
}
HDfree(name_out);
@@ -3126,7 +3126,7 @@ static int test_simple(void)
goto out;
/* allocate a buffer */
- name_out = (char*)HDmalloc(((size_t)name_len+1) * sizeof (char));
+ name_out = (char*)HDmalloc((name_len+1) * sizeof (char));
if(name_out == NULL)
goto out;