summaryrefslogtreecommitdiffstats
path: root/hl/src
diff options
context:
space:
mode:
authorScot Breitenfeld <brtnfld@hdfgroup.org>2011-06-05 21:09:49 (GMT)
committerScot Breitenfeld <brtnfld@hdfgroup.org>2011-06-05 21:09:49 (GMT)
commit4dd38b9f5ba09e863b9a062daf4759a0c85e5b63 (patch)
treebc702c1c6c7cf7f98bdd633695d4f7ff94735f8f /hl/src
parent96256669504627e3f29fae2fb29b7c9bc9934c42 (diff)
downloadhdf5-4dd38b9f5ba09e863b9a062daf4759a0c85e5b63.zip
hdf5-4dd38b9f5ba09e863b9a062daf4759a0c85e5b63.tar.gz
hdf5-4dd38b9f5ba09e863b9a062daf4759a0c85e5b63.tar.bz2
[svn-r20931] Purpose: brought revisions 20870 and 20923 from the trunk
to fix bug HDFFV-7605 Tested: jam (intel compiler)
Diffstat (limited to 'hl/src')
-rw-r--r--hl/src/H5DS.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/hl/src/H5DS.c b/hl/src/H5DS.c
index 379b220..16ab14f 100644
--- a/hl/src/H5DS.c
+++ b/hl/src/H5DS.c
@@ -813,8 +813,10 @@ herr_t H5DSdetach_scale(hid_t did,
/* same object, reset. we want to detach only for this DIM */
if(did_oi.fileno == tmp_oi.fileno && did_oi.addr == tmp_oi.addr) {
- /* copy the last one to replace the one which is found */
- dsbuf[ii] = dsbuf[nelmts-1];
+ /* if we found not the last one, copy the last one to replace
+ the one which is found */
+ if(ii < nelmts-1)
+ dsbuf[ii] = dsbuf[nelmts-1];
nelmts--;
found_dset=1;
break;