summaryrefslogtreecommitdiffstats
path: root/src/H5Glink.c
diff options
context:
space:
mode:
authorDana Robinson <derobins@hdfgroup.org>2020-05-30 07:38:48 (GMT)
committerDana Robinson <derobins@hdfgroup.org>2020-05-30 07:38:48 (GMT)
commit6468a613fd14570a29bb54c0437bbc087f770621 (patch)
tree4c9389c1d670f85a95371271f5411f14e375fdd6 /src/H5Glink.c
parenta1a05d220a037a6f035cadd9316f0eaca88e300f (diff)
downloadhdf5-6468a613fd14570a29bb54c0437bbc087f770621.zip
hdf5-6468a613fd14570a29bb54c0437bbc087f770621.tar.gz
hdf5-6468a613fd14570a29bb54c0437bbc087f770621.tar.bz2
Many normalizations with develop.
Diffstat (limited to 'src/H5Glink.c')
-rw-r--r--src/H5Glink.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/H5Glink.c b/src/H5Glink.c
index 1f4edd5..04ccbc5 100644
--- a/src/H5Glink.c
+++ b/src/H5Glink.c
@@ -417,11 +417,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 +450,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() */