summaryrefslogtreecommitdiffstats
path: root/src/H5Olayout.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2004-08-03 03:37:26 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2004-08-03 03:37:26 (GMT)
commit71ffe29679654c0675f9b242ef5d2fe65f717ff8 (patch)
tree7ee9cfcc831a6670f29795b19d4964eefb1d4402 /src/H5Olayout.c
parent2ac16dbb1cc256b231400c8919726943124a51bf (diff)
downloadhdf5-71ffe29679654c0675f9b242ef5d2fe65f717ff8.zip
hdf5-71ffe29679654c0675f9b242ef5d2fe65f717ff8.tar.gz
hdf5-71ffe29679654c0675f9b242ef5d2fe65f717ff8.tar.bz2
[svn-r8998] Purpose:
Bug fix Description: Correct assertion and fix minor bug with encoding of "older" style layout information which is updated by writing data to a previously empty dataset. Platforms tested: FreeBSD 4.10 (sleipnir) Too minor to require h5committest
Diffstat (limited to 'src/H5Olayout.c')
-rw-r--r--src/H5Olayout.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/H5Olayout.c b/src/H5Olayout.c
index 1839343..1918924 100644
--- a/src/H5Olayout.c
+++ b/src/H5Olayout.c
@@ -271,8 +271,14 @@ H5O_layout_encode(H5F_t *f, uint8_t *p, const void *_mesg)
/* Check for which information to write */
if(mesg->version<3) {
/* number of dimensions */
- assert(mesg->unused.ndims > 0 && mesg->unused.ndims <= H5O_LAYOUT_NDIMS);
- *p++ = mesg->unused.ndims;
+ if(mesg->type!=H5D_CHUNKED) {
+ assert(mesg->unused.ndims > 0 && mesg->unused.ndims <= H5O_LAYOUT_NDIMS);
+ *p++ = mesg->unused.ndims;
+ } /* end if */
+ else {
+ assert(mesg->u.chunk.ndims > 0 && mesg->u.chunk.ndims <= H5O_LAYOUT_NDIMS);
+ *p++ = mesg->u.chunk.ndims;
+ } /* end else */
/* layout class */
*p++ = mesg->type;