summaryrefslogtreecommitdiffstats
path: root/test/tfile.c
diff options
context:
space:
mode:
authorHDF Rational <hdfrat@ncsa.uiuc.edu>2001-10-05 22:27:58 (GMT)
committerHDF Rational <hdfrat@ncsa.uiuc.edu>2001-10-05 22:27:58 (GMT)
commit4b3875ad58a9329691acbff4e3193131d3b6f539 (patch)
tree81706e83eded2326c02827de61be264b53c500e2 /test/tfile.c
parent605f31386ae5198f5e5b3eef51b3729bbd9ab583 (diff)
downloadhdf5-4b3875ad58a9329691acbff4e3193131d3b6f539.zip
hdf5-4b3875ad58a9329691acbff4e3193131d3b6f539.tar.gz
hdf5-4b3875ad58a9329691acbff4e3193131d3b6f539.tar.bz2
[svn-r4526] Purpose:
Code cleanup Description: Purify detected uninitialized memory being read. Solution: Initialization array before writing to disk. Platforms tested: Solaris 2.7 (arabica)
Diffstat (limited to 'test/tfile.c')
-rw-r--r--test/tfile.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/tfile.c b/test/tfile.c
index f5247a9..d3d5b87 100644
--- a/test/tfile.c
+++ b/test/tfile.c
@@ -175,6 +175,7 @@ test_file_create(void)
hid_t dataset_id, dataspace_id; /* identifiers */
hsize_t dims[F2_RANK];
int data[F2_DIM0][F2_DIM1];
+ unsigned i,j;
/* Create the data space for the dataset. */
dims[0] = F2_DIM0;
@@ -186,6 +187,10 @@ test_file_create(void)
dataset_id = H5Dcreate(fid2, "/dset", H5T_NATIVE_INT, dataspace_id, H5P_DEFAULT);
CHECK(dataset_id, FAIL, "H5Dcreate");
+ for(i=0; i<F2_DIM0; i++)
+ for(j=0; j<F2_DIM1; j++)
+ data[i][j]=i*10+j;
+
/* Write data to the new dataset */
ret = H5Dwrite(dataset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data);
CHECK(ret, FAIL, "H5Dwrite");