summaryrefslogtreecommitdiffstats
path: root/src/H5HFdbg.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2013-02-27 19:22:27 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2013-02-27 19:22:27 (GMT)
commitb2f2370b1f26b8864c70f7ccc8cc023260ca99a0 (patch)
treef9bc7e59d6e48d5de16c21f48b214489d58725b3 /src/H5HFdbg.c
parente8fa6193f5ae4713f2ca9ff02965951c9d97016b (diff)
downloadhdf5-b2f2370b1f26b8864c70f7ccc8cc023260ca99a0.zip
hdf5-b2f2370b1f26b8864c70f7ccc8cc023260ca99a0.tar.gz
hdf5-b2f2370b1f26b8864c70f7ccc8cc023260ca99a0.tar.bz2
[svn-r23321] Description:
Merge r23313 from trunk to 1.8 branch: Bring changes from Coverity branch to the trunk: r20612: Changed string functions to versions with string length to fix coverity issues 922, 942 and 943. r20614: Use HDsnprintf. --gh r20675: Fix for coverity #1714 due to the fix for #810. Use HDfree() instead of H5MM_xfree(). r20678: Repaired coverity issue #598 -- failure to check return value from a call to fstat(), or to tidy up in the event of failure. r20679: Use HDstrncpy. --gh r20681: Use HDstrncat and HDstrncpy. --gh Tested on: Mac OSX/64 10.8.2 (amazon) w/debug, C++ & FORTRAN (too minor to require h5committest)
Diffstat (limited to 'src/H5HFdbg.c')
-rw-r--r--src/H5HFdbg.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/H5HFdbg.c b/src/H5HFdbg.c
index b5ac40a..3e4515f 100644
--- a/src/H5HFdbg.c
+++ b/src/H5HFdbg.c
@@ -187,7 +187,7 @@ H5HF_dtable_debug(const H5HF_dtable_t *dtable, FILE *stream, int indent, int fwi
void
H5HF_hdr_print(const H5HF_hdr_t *hdr, hid_t dxpl_id, hbool_t dump_internal, FILE *stream, int indent, int fwidth)
{
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_NOAPI_NOINIT_NOERR
/*
* Check arguments.
@@ -381,7 +381,7 @@ H5HF_dblock_debug_cb(H5FS_section_info_t *_sect, void *_udata)
size_t start, end; /* Start & end of the overlapping area */
size_t len; /* Length of the overlapping area */
size_t overlap; /* Track any overlaps */
- unsigned u; /* Local index variable */
+ size_t u; /* Local index variable */
/* Calculate the starting & ending */
if(sect_start < dblock_start)
@@ -396,7 +396,7 @@ H5HF_dblock_debug_cb(H5FS_section_info_t *_sect, void *_udata)
/* Calculate the length */
len = end - start;
- sprintf(temp_str, "Section #%u:", (unsigned)udata->sect_count);
+ HDsnprintf(temp_str, sizeof(temp_str), "Section #%u:", (unsigned)udata->sect_count);
HDfprintf(udata->stream, "%*s%-*s %8Zu, %8Zu\n", udata->indent + 3, "", MAX(0, udata->fwidth - 9),
temp_str,
start, len);
@@ -533,7 +533,7 @@ H5HF_dblock_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream,
HDfprintf(stream, "%*s%-*s %.2f%%\n", indent, "", fwidth,
"Percent of available space for data used:",
- (100.0 * (double)((dblock->size - blk_prefix_size) - amount_free) / (double)(dblock->size - blk_prefix_size)));
+ ((double)100.0f * (double)((dblock->size - blk_prefix_size) - amount_free) / (double)(dblock->size - blk_prefix_size)));
/*
* Print the data in a VMS-style octal dump.
@@ -572,7 +572,7 @@ H5HF_iblock_print(const H5HF_indirect_t *iblock,
char temp_str[64]; /* Temporary string, for formatting */
size_t u, v; /* Local index variable */
- FUNC_ENTER_NOAPI_NOINIT
+ FUNC_ENTER_NOAPI_NOINIT_NOERR
/*
* Check arguments.
@@ -617,13 +617,13 @@ H5HF_iblock_print(const H5HF_indirect_t *iblock,
else
HDfprintf(stream, "%*sDirect Block Entries: (address)\n", indent, "");
for(u = 0; u < hdr->man_dtable.max_direct_rows && u < iblock->nrows; u++) {
- sprintf(temp_str, "Row #%u: (block size: %lu)", (unsigned)u, (unsigned long)hdr->man_dtable.row_block_size[u]);
+ HDsnprintf(temp_str, sizeof(temp_str), "Row #%u: (block size: %lu)", (unsigned)u, (unsigned long)hdr->man_dtable.row_block_size[u]);
HDfprintf(stream, "%*s%-*s\n", indent + 3, "", MAX(0, fwidth - 3),
temp_str);
for(v = 0; v < hdr->man_dtable.cparam.width; v++) {
size_t off = (u * hdr->man_dtable.cparam.width) + v;
- sprintf(temp_str, "Col #%u:", (unsigned)v);
+ HDsnprintf(temp_str, sizeof(temp_str), "Col #%u:", (unsigned)v);
if(hdr->filter_len > 0)
HDfprintf(stream, "%*s%-*s %9a/%6Zu/%x\n", indent + 6, "", MAX(0, fwidth - 6),
temp_str,
@@ -645,13 +645,13 @@ H5HF_iblock_print(const H5HF_indirect_t *iblock,
H5V_log2_of2(hdr->man_dtable.cparam.width);
for(u = hdr->man_dtable.max_direct_rows; u < iblock->nrows; u++) {
num_indirect_rows = (H5V_log2_gen(hdr->man_dtable.row_block_size[u]) - first_row_bits) + 1;
- sprintf(temp_str, "Row #%u: (# of rows: %u)", (unsigned)u, num_indirect_rows);
+ HDsnprintf(temp_str, sizeof(temp_str), "Row #%u: (# of rows: %u)", (unsigned)u, num_indirect_rows);
HDfprintf(stream, "%*s%-*s\n", indent + 3, "", MAX(0, fwidth - 3),
temp_str);
for(v = 0; v < hdr->man_dtable.cparam.width; v++) {
size_t off = (u * hdr->man_dtable.cparam.width) + v;
- sprintf(temp_str, "Col #%u:", (unsigned)v);
+ HDsnprintf(temp_str, sizeof(temp_str), "Col #%u:", (unsigned)v);
HDfprintf(stream, "%*s%-*s %9a\n", indent + 6, "", MAX(0, fwidth - 6),
temp_str,
iblock->ents[off].addr);