summaryrefslogtreecommitdiffstats
path: root/tools/lib/h5diff_attr.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2013-03-20 03:44:28 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2013-03-20 03:44:28 (GMT)
commit59dd5665a5887efa8e91e0339719e4bd0c2be2a6 (patch)
treef00ce45d9f64ae1c06d043947fb6d65900160d26 /tools/lib/h5diff_attr.c
parent8ad18f496ad665faffc4f2fd0eae8140b53ab760 (diff)
downloadhdf5-59dd5665a5887efa8e91e0339719e4bd0c2be2a6.zip
hdf5-59dd5665a5887efa8e91e0339719e4bd0c2be2a6.tar.gz
hdf5-59dd5665a5887efa8e91e0339719e4bd0c2be2a6.tar.bz2
[svn-r23395] Description:
Bring Coverity changes from branch to trunk: r20682: fixed coverity: 76, 77, 635, 636, 1164, 1165, 1166, 1121, 1122, 1117, 1343 Tested on: Mac OSX/64 10.8.3 (amazon) w/C++ & FORTRAN (too minor to require h5committest)
Diffstat (limited to 'tools/lib/h5diff_attr.c')
-rw-r--r--tools/lib/h5diff_attr.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/tools/lib/h5diff_attr.c b/tools/lib/h5diff_attr.c
index 4899200..ef1d761 100644
--- a/tools/lib/h5diff_attr.c
+++ b/tools/lib/h5diff_attr.c
@@ -108,17 +108,17 @@ static void table_attrs_free( table_attrs_t *table )
*------------------------------------------------------------------------*/
static void table_attr_mark_exist(unsigned *exist, char *name, table_attrs_t *table)
{
- unsigned int new;
+ size_t new_val;
if(table->nattrs == table->size) {
table->size = MAX(1, table->size * 2);
table->attrs = (match_attr_t *)HDrealloc(table->attrs, table->size * sizeof(match_attr_t));
} /* end if */
- new = table->nattrs++;
- table->attrs[new].exist[0] = exist[0];
- table->attrs[new].exist[1] = exist[1];
- table->attrs[new].name = (char *)HDstrdup(name);
+ new_val = table->nattrs++;
+ table->attrs[new_val].exist[0] = exist[0];
+ table->attrs[new_val].exist[1] = exist[1];
+ table->attrs[new_val].name = (char *)HDstrdup(name);
}
/*-------------------------------------------------------------------------
@@ -459,8 +459,8 @@ hsize_t diff_attr(hid_t loc1_id,
goto error;
/* format output string */
- sprintf(np1,"%s of <%s>",name1,path1);
- sprintf(np2,"%s of <%s>",name2,path2);
+ HDsnprintf(np1, sizeof(np1), "%s of <%s>", name1, path1);
+ HDsnprintf(np2, sizeof(np1), "%s of <%s>", name2, path2);
/*---------------------------------------------------------------------
* array compare