summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/H5Gdeprec.c10
-rw-r--r--src/H5Gpublic.h12
2 files changed, 11 insertions, 11 deletions
diff --git a/src/H5Gdeprec.c b/src/H5Gdeprec.c
index 453796e..45065e8 100644
--- a/src/H5Gdeprec.c
+++ b/src/H5Gdeprec.c
@@ -141,10 +141,10 @@ H5G_map_obj_type(H5O_type_t obj_type)
* specified NAME. The group is opened for write access
* and it's object ID is returned.
*
- * The optional SIZE_HINT specifies how much file space to
- * reserve to store the names that will appear in this
- * group. If a non-positive value is supplied for the SIZE_HINT
- * then a default size is chosen.
+ * The SIZE_HINT parameter specifies how much file space to reserve
+ * to store the names that will appear in this group. This number
+ * must be less than or equal to UINT32_MAX. If zero is supplied
+ * for the SIZE_HINT then a default size is chosen.
*
* Note: Deprecated in favor of H5Gcreate2
*
@@ -174,6 +174,8 @@ H5Gcreate1(hid_t loc_id, const char *name, size_t size_hint)
/* Check arguments */
if (!name || !*name)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "no name given")
+ if (size_hint > UINT32_MAX)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "size_hint cannot be larger than UINT32_MAX")
/* Check if we need to create a non-standard GCPL */
if (size_hint > 0) {
diff --git a/src/H5Gpublic.h b/src/H5Gpublic.h
index 416ff2c..b009d41 100644
--- a/src/H5Gpublic.h
+++ b/src/H5Gpublic.h
@@ -569,8 +569,8 @@ typedef struct H5G_stat_t {
*
* \fgdta_loc_id
* \param[in] name Name of the group to create
- * \param[in] size_hint Optional parameter indicating the number of bytes
- * to reserve for the names that will appear in the group
+ * \param[in] size_hint The number of bytes to reserve for the names
+ * that will appear in the group
*
* \return \hid_t{group}
*
@@ -592,11 +592,9 @@ typedef struct H5G_stat_t {
* group, is not limited.
*
* \p size_hint is a hint for the number of bytes to reserve to store
- * the names which will be eventually added to the new group. Passing a
- * value of zero for \p size_hint is usually adequate since the library
- * is able to dynamically resize the name heap, but a correct hint may
- * result in better performance. If a non-positive value is supplied
- * for \p size_hint, then a default size is chosen.
+ * the names which will be eventually added to the new group. This
+ * value must be between 0 and UINT32_MAX (inclusive). If this
+ * parameter is zero, a default value will be used.
*
* The return value is a group identifier for the open group. This
* group identifier should be closed by calling H5Gclose() when it is