summaryrefslogtreecommitdiffstats
path: root/tools/lib
diff options
context:
space:
mode:
authorPedro Vicente Nunes <pvn@hdfgroup.org>2008-12-23 14:56:13 (GMT)
committerPedro Vicente Nunes <pvn@hdfgroup.org>2008-12-23 14:56:13 (GMT)
commit5b7de16d6a40fcd39b3d7598d0415ab45e91aeee (patch)
tree0aa77d26b2bcb26d986413080661e78e5c2ec5dc /tools/lib
parent1448a3e8bbc720280a0c8c88aa928d3c87876b9e (diff)
downloadhdf5-5b7de16d6a40fcd39b3d7598d0415ab45e91aeee.zip
hdf5-5b7de16d6a40fcd39b3d7598d0415ab45e91aeee.tar.gz
hdf5-5b7de16d6a40fcd39b3d7598d0415ab45e91aeee.tar.bz2
[svn-r16217] Bug fix
PG compiler complains about array out of bounds (a rank of zero was not checked) Adding a scalar dataset to the test generator program. this case is run on a previous existing run, the case was added to 2 existing files Tested: windows, linux
Diffstat (limited to 'tools/lib')
-rw-r--r--tools/lib/h5diff_array.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/tools/lib/h5diff_array.c b/tools/lib/h5diff_array.c
index 2476aaf..5d187cd 100644
--- a/tools/lib/h5diff_array.c
+++ b/tools/lib/h5diff_array.c
@@ -209,13 +209,17 @@ hsize_t diff_array( void *_mem1,
/* get the size. */
size = H5Tget_size( m_type );
- acc[rank-1]=1;
- for(j=(rank-2); j>=0; j--)
+ if ( rank > 0 )
{
- acc[j]=acc[j+1]*dims[j+1];
+
+ acc[rank-1]=1;
+ for(j=(rank-2); j>=0; j--)
+ {
+ acc[j]=acc[j+1]*dims[j+1];
+ }
+ for ( j = 0; j < rank; j++)
+ pos[j]=0;
}
- for ( j = 0; j < rank; j++)
- pos[j]=0;
if(H5Tis_variable_str(m_type))
{
@@ -5573,6 +5577,10 @@ void print_pos( int *ph, /* print header */
}
parallel_print("]" );
}
+ else
+ {
+ parallel_print(" ");
+ }
}
/*-------------------------------------------------------------------------