summaryrefslogtreecommitdiffstats
path: root/tools/src/h5import/h5import.c
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2018-10-09 14:23:09 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2018-10-17 15:57:56 (GMT)
commit633b7f93ce6f2cca85c9930010fded235ff8eaa6 (patch)
treed97582532c8e190c8936ee83cd3d1bb8a2a53d07 /tools/src/h5import/h5import.c
parenta82aee9a5fb4b10951d95a0422a4125b18fe9a52 (diff)
downloadhdf5-633b7f93ce6f2cca85c9930010fded235ff8eaa6.zip
hdf5-633b7f93ce6f2cca85c9930010fded235ff8eaa6.tar.gz
hdf5-633b7f93ce6f2cca85c9930010fded235ff8eaa6.tar.bz2
TRILAB-81 coverity fixes
Diffstat (limited to 'tools/src/h5import/h5import.c')
-rw-r--r--tools/src/h5import/h5import.c12
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;
}