summaryrefslogtreecommitdiffstats
path: root/src/H5Glink.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5Glink.c')
-rw-r--r--src/H5Glink.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/H5Glink.c b/src/H5Glink.c
index 1f4edd5..26747e4 100644
--- a/src/H5Glink.c
+++ b/src/H5Glink.c
@@ -15,7 +15,7 @@
*
* Created: H5Glink.c
* Nov 13 2006
- * Quincey Koziol <koziol@hdfgroup.org>
+ * Quincey Koziol
*
* Purpose: Functions for handling links in groups.
*
@@ -96,7 +96,6 @@ static int H5G_link_cmp_corder_dec(const void *lnk1, const void *lnk2);
* (i.e. same as strcmp())
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Sep 5 2005
*
*-------------------------------------------------------------------------
@@ -123,7 +122,6 @@ H5G_link_cmp_name_inc(const void *lnk1, const void *lnk2)
* (i.e. opposite strcmp())
*
* Programmer: Quincey Koziol
- * koziol@ncsa.uiuc.edu
* Sep 25 2006
*
*-------------------------------------------------------------------------
@@ -149,7 +147,6 @@ H5G_link_cmp_name_dec(const void *lnk1, const void *lnk2)
* as equal, their order in the sorted array is undefined.
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Nov 6 2006
*
*-------------------------------------------------------------------------
@@ -184,7 +181,6 @@ H5G_link_cmp_corder_inc(const void *lnk1, const void *lnk2)
* as equal, their order in the sorted array is undefined.
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Nov 6 2006
*
*-------------------------------------------------------------------------
@@ -215,7 +211,6 @@ H5G_link_cmp_corder_dec(const void *lnk1, const void *lnk2)
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Sep 16 2006
*
*-------------------------------------------------------------------------
@@ -417,11 +412,20 @@ herr_t
H5G__link_sort_table(H5G_link_table_t *ltable, H5_index_t idx_type,
H5_iter_order_t order)
{
+ herr_t ret_value = SUCCEED;
+
FUNC_ENTER_PACKAGE_NOERR
/* Sanity check */
HDassert(ltable);
+ /* Can't sort when empty since the links table will be NULL */
+ if(0 == ltable->nlinks)
+ HGOTO_DONE(ret_value);
+
+ /* This should never be NULL if the number of links is non-zero */
+ HDassert(ltable->lnks);
+
/* Pick appropriate sorting routine */
if(idx_type == H5_INDEX_NAME) {
if(order == H5_ITER_INC)
@@ -441,6 +445,7 @@ H5G__link_sort_table(H5G_link_table_t *ltable, H5_index_t idx_type,
HDassert(order == H5_ITER_NATIVE);
} /* end else */
+done:
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5G__link_sort_table() */
@@ -546,7 +551,6 @@ done:
* Return: Non-negative on success/Negative on failure
*
* Programmer: Quincey Koziol
- * koziol@hdfgroup.org
* Nov 13 2006
*
*-------------------------------------------------------------------------