summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/h5dump/h5dump.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/tools/h5dump/h5dump.c b/tools/h5dump/h5dump.c
index 4cf3181..972d998 100644
--- a/tools/h5dump/h5dump.c
+++ b/tools/h5dump/h5dump.c
@@ -2740,10 +2740,12 @@ main(int argc, const char *argv[])
}
}
- if (argv[opt_ind][0] == '\\')
- fname = &argv[opt_ind][1];
- else
- fname = argv[opt_ind];
+ if (argc <= opt_ind) {
+ error_msg(progname, "missing file name\n");
+ usage(progname);
+ exit(EXIT_FAILURE);
+ }
+ fname = argv[opt_ind];
fid = h5tools_fopen(fname, driver, NULL, 0);