summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2003-06-09 19:12:56 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2003-06-09 19:12:56 (GMT)
commit1e495825d220271cca2b4e23734270b19a848f10 (patch)
treee24e51ff4e685ac6448f9224412a6da2361fee80
parent54b28eeea76aef046acdb3d761eb2128392369c3 (diff)
downloadhdf5-1e495825d220271cca2b4e23734270b19a848f10.zip
hdf5-1e495825d220271cca2b4e23734270b19a848f10.tar.gz
hdf5-1e495825d220271cca2b4e23734270b19a848f10.tar.bz2
[svn-r6999] Purpose:
Bug fix. Description: Don't dump core when displaying global heaps in h5debug. Platforms tested: FreeBSD 4.8 (sleipnir) h5committest Misc. update: Patch submitted by Robb
-rw-r--r--src/H5HG.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/H5HG.c b/src/H5HG.c
index 6428503..7f6f59f 100644
--- a/src/H5HG.c
+++ b/src/H5HG.c
@@ -1060,6 +1060,9 @@ done:
* Modifications:
* Robb Matzke, 1999-07-28
* The ADDR argument is passed by value.
+ *
+ * Robb Matzke, LLNL, 2003-06-05
+ * The size does not include the object header, just the data.
*-------------------------------------------------------------------------
*/
herr_t
@@ -1070,7 +1073,6 @@ H5HG_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent,
unsigned j, k;
H5HG_heap_t *h = NULL;
char buf[64];
- size_t size;
uint8_t *p = NULL;
herr_t ret_value=SUCCEED; /* Return value */
@@ -1120,19 +1122,18 @@ H5HG_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent,
"Size of object body:",
(unsigned long)(h->obj[u].size),
(unsigned long)H5HG_ALIGN(h->obj[u].size));
- size = h->obj[u].size - H5HG_SIZEOF_OBJHDR (f);
p = h->obj[u].begin + H5HG_SIZEOF_OBJHDR (f);
- for (j=0; j<size; j+=16) {
+ for (j=0; j<h->obj[u].size; j+=16) {
fprintf (stream, "%*s%04d: ", indent+6, "", j);
for (k=0; k<16; k++) {
if (8==k) fprintf (stream, " ");
- if (j+k<size) {
+ if (j+k<h->obj[u].size) {
fprintf (stream, "%02x ", p[j+k]);
} else {
HDfputs(" ", stream);
}
}
- for (k=0; k<16 && j+k<size; k++) {
+ for (k=0; k<16 && j+k<h->obj[u].size; k++) {
if (8==k) fprintf (stream, " ");
HDfputc(p[j+k]>' ' && p[j+k]<='~' ? p[j+k] : '.', stream);
}