summaryrefslogtreecommitdiffstats
path: root/tools/h5dump/h5dumpgentest.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2013-09-05 20:44:14 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2013-09-05 20:44:14 (GMT)
commit5b876c929f79003c85585570827452f5d8052d01 (patch)
tree89a1fa7bb8221a8679f180868467464e331c18ce /tools/h5dump/h5dumpgentest.c
parenta1fe10691cf7ce1737aa420191efb996f7fe5657 (diff)
downloadhdf5-5b876c929f79003c85585570827452f5d8052d01.zip
hdf5-5b876c929f79003c85585570827452f5d8052d01.tar.gz
hdf5-5b876c929f79003c85585570827452f5d8052d01.tar.bz2
[svn-r24101] Description:
Clean up warnings, enable new compiler warning flag(s) and bring back changes from Coverity branch: r20813: Remove the dead code as listed for coverity bug #1722. h5committested. r20814: Issue 69: Check return value and throw error if negative return. Also free datatype id on error r20815: Use HDstrncpy. --gh r20816: Replaced one last HDstrcat call with HDstrncat to resolve coverity issue 832. r20817: Use HDstrncpy and HDstrncat. --gh r20818: Purpose: Fix valgrind issues with h5jam Description: Modified h5jam to free strings strdup'd in parse_command_line before exit. Note that they may still not be freed in case of error, due to the widespread use of exit(). r20819: Issue 80: change loop to use int as loop index. r20820: Maintenance: Fixed the bug found by coverity CID 788 There were two problems with this function: 1) it tried to unnecessary free NULL pointer 2) it tried to allocate c_name buffer that is done by H5Pget_class_name Tested on: Mac OSX 10.8.4 (amazon) w/gcc 4.8.1, C++ & FORTRAN (too minor to require h5committest)
Diffstat (limited to 'tools/h5dump/h5dumpgentest.c')
-rw-r--r--tools/h5dump/h5dumpgentest.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/tools/h5dump/h5dumpgentest.c b/tools/h5dump/h5dumpgentest.c
index 71b1e65..88035a2 100644
--- a/tools/h5dump/h5dumpgentest.c
+++ b/tools/h5dump/h5dumpgentest.c
@@ -3839,7 +3839,7 @@ static void write_attr_in(hid_t loc_id,
/* create 1D attributes with dimension [2], 2 elements */
hsize_t dims[1]={2};
- char buf1[2][2]= {"ab","de"}; /* string */
+ char buf1[2][3]= {"ab","de"}; /* string */
char buf2[2]= {1,2}; /* bitfield, opaque */
s_t buf3[2]= {{1,2},{3,4}}; /* compound */
hobj_ref_t buf4[2]; /* reference */
@@ -3851,7 +3851,7 @@ static void write_attr_in(hid_t loc_id,
/* create 2D attributes with dimension [3][2], 6 elements */
hsize_t dims2[2]={3,2};
- char buf12[6][2]= {"ab","cd","ef","gh","ij","kl"}; /* string */
+ char buf12[6][3]= {"ab","cd","ef","gh","ij","kl"}; /* string */
char buf22[3][2]= {{1,2},{3,4},{5,6}}; /* bitfield, opaque */
s_t buf32[6]= {{1,2},{3,4},{5,6},{7,8},{9,10},{11,12}}; /* compound */
hobj_ref_t buf42[3][2]; /* reference */
@@ -3862,7 +3862,7 @@ static void write_attr_in(hid_t loc_id,
/* create 3D attributes with dimension [4][3][2], 24 elements */
hsize_t dims3[3]={4,3,2};
- char buf13[24][2]= {"ab","cd","ef","gh","ij","kl","mn","pq",
+ char buf13[24][3]= {"ab","cd","ef","gh","ij","kl","mn","pq",
"rs","tu","vw","xz","AB","CD","EF","GH",
"IJ","KL","MN","PQ","RS","TU","VW","XZ"}; /* string */
char buf23[4][3][2]; /* bitfield, opaque */
@@ -4281,7 +4281,7 @@ static void write_dset_in(hid_t loc_id,
/* create 1D attributes with dimension [2], 2 elements */
hsize_t dims[1]={2};
- char buf1[2][2]= {"ab","de"}; /* string */
+ char buf1[2][3]= {"ab","de"}; /* string */
char buf2[2]= {1,2}; /* bitfield, opaque */
s_t buf3[2]= {{1,2},{3,4}}; /* compound */
hobj_ref_t buf4[2]; /* reference */
@@ -4293,7 +4293,7 @@ static void write_dset_in(hid_t loc_id,
/* create 2D attributes with dimension [3][2], 6 elements */
hsize_t dims2[2]={3,2};
- char buf12[6][2]= {"ab","cd","ef","gh","ij","kl"}; /* string */
+ char buf12[6][3]= {"ab","cd","ef","gh","ij","kl"}; /* string */
char buf22[3][2]= {{1,2},{3,4},{5,6}}; /* bitfield, opaque */
s_t buf32[6]= {{1,2},{3,4},{5,6},{7,8},{9,10},{11,12}}; /* compound */
hobj_ref_t buf42[3][2]; /* reference */
@@ -4304,7 +4304,7 @@ static void write_dset_in(hid_t loc_id,
/* create 3D attributes with dimension [4][3][2], 24 elements */
hsize_t dims3[3]={4,3,2};
- char buf13[24][2]= {"ab","cd","ef","gh","ij","kl","mn","pq",
+ char buf13[24][3]= {"ab","cd","ef","gh","ij","kl","mn","pq",
"rs","tu","vw","xz","AB","CD","EF","GH",
"IJ","KL","MN","PQ","RS","TU","VW","XZ"}; /* string */
char buf23[4][3][2]; /* bitfield, opaque */