summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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");