diff options
author | Robb Matzke <matzke@llnl.gov> | 1997-08-29 16:58:58 (GMT) |
---|---|---|
committer | Robb Matzke <matzke@llnl.gov> | 1997-08-29 16:58:58 (GMT) |
commit | 9ada2de83a7a4038e4b3d0e500360eb38ee6ecaa (patch) | |
tree | db7a65c1bffc65e3d16f2e1c2c236e8fc813d64d /src/H5O.c | |
parent | 969654ce4518e753b0055aed7613461be5bf5210 (diff) | |
download | hdf5-9ada2de83a7a4038e4b3d0e500360eb38ee6ecaa.zip hdf5-9ada2de83a7a4038e4b3d0e500360eb38ee6ecaa.tar.gz hdf5-9ada2de83a7a4038e4b3d0e500360eb38ee6ecaa.tar.bz2 |
[svn-r50] ./src/H5G.c
Commented out H5G_basename(). Fixed a bug in H5G_namei() and
H5G_insert().
./src/H5O.c
Fixed a bug in H5O_modify()
Diffstat (limited to 'src/H5O.c')
-rw-r--r-- | src/H5O.c | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -728,15 +728,15 @@ H5O_modify (hdf5_file_t *f, haddr_t addr, H5G_entry_t *ent, } /* Count similar messages */ - for (idx=sequence=0; idx<oh->nmesgs; idx++) { + for (idx=0,sequence=-1; idx<oh->nmesgs; idx++) { if (type->id != oh->mesg[idx].type->id) continue; - if (sequence==overwrite) break; - sequence++; + if (++sequence==overwrite) break; } /* Was the right message found? */ - if (overwrite>=0 && sequence!=overwrite) { - HRETURN_ERROR (H5E_OHDR, H5E_NOTFOUND, FAIL); + if (overwrite>=0 && + (idx>=oh->nmesgs || sequence!=overwrite)) { + HRETURN_ERROR (H5E_OHDR, H5E_NOTFOUND, FAIL); /*message not found*/ } /* Allocate space for the new message */ @@ -745,6 +745,7 @@ H5O_modify (hdf5_file_t *f, haddr_t addr, H5G_entry_t *ent, H5O_ALIGN (size, oh->alignment); idx = H5O_alloc (f, oh, type, size); if (idx<0) HRETURN_ERROR (H5E_OHDR, H5E_CANTINIT, FAIL); + sequence++; } /* Copy the native value into the object header */ |