summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChristian Chilan <chilan@hdfgroup.org>2007-01-17 20:47:44 (GMT)
committerChristian Chilan <chilan@hdfgroup.org>2007-01-17 20:47:44 (GMT)
commit36d59974a6e5192935793c6a6db9159aa3776133 (patch)
tree0588cdfd30223bd82fbb74557d207d2eb3e943fb /src
parentc97fae2f00b2da230437f5848b8537a0e991ec08 (diff)
downloadhdf5-36d59974a6e5192935793c6a6db9159aa3776133.zip
hdf5-36d59974a6e5192935793c6a6db9159aa3776133.tar.gz
hdf5-36d59974a6e5192935793c6a6db9159aa3776133.tar.bz2
[svn-r13146] Verifies that current dataspace dimensions are not equal to H5S_UNLIMITED.
Checks performed in H5Screate_simple() and H5Sset_extent_simple().
Diffstat (limited to 'src')
-rw-r--r--src/H5S.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/H5S.c b/src/H5S.c
index 0e90661..dc81f9b 100644
--- a/src/H5S.c
+++ b/src/H5S.c
@@ -1260,6 +1260,9 @@ H5Sis_simple(hid_t space_id)
MODIFICATION
A null dataspace cannot be created from simple space with this function.
+ Christian Chilan 01/17/2007
+ Verifies that each element of DIMS is not equal to H5S_UNLIMITED.
+
--------------------------------------------------------------------------*/
herr_t
H5Sset_extent_simple(hid_t space_id, int rank, const hsize_t dims[/*rank*/],
@@ -1281,6 +1284,8 @@ H5Sset_extent_simple(hid_t space_id, int rank, const hsize_t dims[/*rank*/],
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid rank");
if (dims) {
for (u=0; u<rank; u++) {
+ if (H5S_UNLIMITED==dims[u])
+ HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "current dimension must have a specific size, not H5S_UNLIMITED");
if (((max!=NULL && max[u]!=H5S_UNLIMITED) || max==NULL) && dims[u]==0)
HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "invalid dimension size");
}
@@ -1564,7 +1569,9 @@ done:
* Programmer: Quincey Koziol
* Tuesday, January 27, 1998
*
- * Modifications:
+ * Modifications: Christian Chilan 01/17/2007
+ * Verifies that each element of DIMS is not equal to
+ * H5S_UNLIMITED.
*
*-------------------------------------------------------------------------
*/
@@ -1588,6 +1595,8 @@ H5Screate_simple(int rank, const hsize_t dims[/*rank*/],
HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "no dimensions specified");
/* Check whether the current dimensions are valid */
for (i=0; i<rank; i++) {
+ if (H5S_UNLIMITED==dims[i])
+ HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "current dimension must have a specific size, not H5S_UNLIMITED");
if (maxdims) {
if (H5S_UNLIMITED!=maxdims[i] && maxdims[i]<dims[i])
HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "maxdims is smaller than dims");