diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2014-05-17 03:22:51 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2014-05-17 03:22:51 (GMT) |
commit | a613b70f93595fb8eacbe3ac076fe4d66f294d4f (patch) | |
tree | f2f4fd54a635c6df6039265f45c8c1bef3e28127 /tools/h5ls | |
parent | 896a5e7992a8419b4214406397093ac1c2bf9eab (diff) | |
download | hdf5-a613b70f93595fb8eacbe3ac076fe4d66f294d4f.zip hdf5-a613b70f93595fb8eacbe3ac076fe4d66f294d4f.tar.gz hdf5-a613b70f93595fb8eacbe3ac076fe4d66f294d4f.tar.bz2 |
[svn-r25197] Description:
Bring changes from hdf5_1_8_coverity branch back to trunk:
r20878:
Issue 76: Check if H5Tget_nmembers(type) fails and simply return(FALSE). Also move printf to after check.
r20880:
Issue 192: Create ret_val var set to -1. Add out label for failures to jump to, return ret_val at bottom.
r20882:
Fixes for coverity:
1) bug #1679: remove dead code in test/mf.c
2) bug #1680: remove dead code in tools/lib/h5diff_dset.c
r20883:
Fix coverity issue 585
Description:
Changed variable "c" in processStrData in h5import.c to an int, to match fgetc
return value, and removed call to feof, instead checking if c == EOF.
Tested on:
MacOSX/64 10.9.3 (amazon) w/C++, FORTRAN & parallel
(too minor to require h5committest)
Diffstat (limited to 'tools/h5ls')
-rw-r--r-- | tools/h5ls/h5ls.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/tools/h5ls/h5ls.c b/tools/h5ls/h5ls.c index 33fc17a..2030221 100644 --- a/tools/h5ls/h5ls.c +++ b/tools/h5ls/h5ls.c @@ -816,8 +816,6 @@ print_float_type(h5tools_str_t *buffer, hid_t type, int ind) * Programmer: Robb Matzke * Thursday, November 5, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ static hbool_t @@ -832,8 +830,7 @@ print_cmpd_type(h5tools_str_t *buffer, hid_t type, int ind) if(H5T_COMPOUND != H5Tget_class(type)) return FALSE; - nmembs = H5Tget_nmembers(type); - if(nmembs <= 0) + if((nmembs = H5Tget_nmembers(type)) < 0) return FALSE; h5tools_str_append(buffer, "struct {"); @@ -855,6 +852,7 @@ print_cmpd_type(h5tools_str_t *buffer, hid_t type, int ind) size = H5Tget_size(type); h5tools_str_append(buffer, "\n%*s} %lu byte%s", ind, "", (unsigned long)size, 1==size?"":"s"); + return TRUE; } @@ -883,8 +881,7 @@ print_enum_type(h5tools_str_t *buffer, hid_t type, int ind) if(H5T_ENUM != H5Tget_class(type)) return FALSE; - nmembs = H5Tget_nmembers(type); - if(nmembs < 0) + if((nmembs = H5Tget_nmembers(type)) < 0) return FALSE; super = H5Tget_super(type); |