diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2018-10-09 14:23:09 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2018-10-17 15:57:56 (GMT) |
commit | 633b7f93ce6f2cca85c9930010fded235ff8eaa6 (patch) | |
tree | d97582532c8e190c8936ee83cd3d1bb8a2a53d07 /tools/src/h5import | |
parent | a82aee9a5fb4b10951d95a0422a4125b18fe9a52 (diff) | |
download | hdf5-633b7f93ce6f2cca85c9930010fded235ff8eaa6.zip hdf5-633b7f93ce6f2cca85c9930010fded235ff8eaa6.tar.gz hdf5-633b7f93ce6f2cca85c9930010fded235ff8eaa6.tar.bz2 |
TRILAB-81 coverity fixes
Diffstat (limited to 'tools/src/h5import')
-rw-r--r-- | tools/src/h5import/h5import.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/tools/src/h5import/h5import.c b/tools/src/h5import/h5import.c index 3b64a0e..ea40322 100644 --- a/tools/src/h5import/h5import.c +++ b/tools/src/h5import/h5import.c @@ -98,6 +98,9 @@ int main(int argc, char *argv[]) (void) HDsetvbuf(stderr, (char *) NULL, _IOLBF, 0); (void) HDsetvbuf(stdout, (char *) NULL, _IOLBF, 0); + /* Initialize the file structure to 0 */ + HDmemset(&opt, 0, sizeof(struct Options)); + if (argv[1] && (HDstrcmp("-V", argv[1]) == 0)) { print_version(PROGRAMNAME); HDexit(EXIT_SUCCESS); @@ -112,9 +115,6 @@ int main(int argc, char *argv[]) goto err; } - /* Initialize the file structure to 0 */ - HDmemset(&opt, 0, sizeof(struct Options)); - /* * parse the command line */ @@ -1665,7 +1665,7 @@ static int processConfigurationFile(char *infile, struct Input *in) } else { /* Dimension */ icount++; - if (icount > MAX_NUM_DIMENSION) { + if (icount >+ MAX_NUM_DIMENSION) { (void) HDfprintf(stderr, "Invalid value for rank.\n"); goto error; } @@ -1750,7 +1750,7 @@ static int processConfigurationFile(char *infile, struct Input *in) } else { /* comma */ i++; - if (i > MAX_NUM_DIMENSION) { + if (i >= MAX_NUM_DIMENSION) { (void) HDfprintf(stderr, "Invalid value for rank.\n"); goto error; } @@ -2023,7 +2023,7 @@ static int processConfigurationFile(char *infile, struct Input *in) } else { /* Dimension */ icount++; - if (icount > MAX_NUM_DIMENSION) { + if (icount >= MAX_NUM_DIMENSION) { (void) HDfprintf(stderr, "Invalid value for rank.\n"); goto error; } |