summaryrefslogtreecommitdiffstats
path: root/test/vfd_swmr_dsetchks_writer.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/vfd_swmr_dsetchks_writer.c')
-rw-r--r--test/vfd_swmr_dsetchks_writer.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/test/vfd_swmr_dsetchks_writer.c b/test/vfd_swmr_dsetchks_writer.c
index 1d9bc4c..a02a042 100644
--- a/test/vfd_swmr_dsetchks_writer.c
+++ b/test/vfd_swmr_dsetchks_writer.c
@@ -265,10 +265,14 @@ state_init(state_t *s, int argc, char **argv)
int ch;
char tfile[PATH_MAX];
char * end;
+ char * base;
+
+ if (H5_basename(tfile, base) < 0)
+ TEST_ERROR
*s = ALL_HID_INITIALIZER;
esnprintf(tfile, sizeof(tfile), "%s", argv[0]);
- esnprintf(s->progname, sizeof(s->progname), "%s", basename(tfile));
+ esnprintf(s->progname, sizeof(s->progname), "%s", base);
while ((ch = getopt(argc, argv, "siferom:n:x:y:g:p:t:l:bqSNu:c:")) != -1) {
switch (ch) {
@@ -370,6 +374,8 @@ state_init(state_t *s, int argc, char **argv)
argc -= optind;
argv += optind;
+ HDfree(base);
+
/* Require to specify at least -s or -i or -f or -e or -r option */
if (!s->single_index && !s->implicit_index && !s->fa_index && !s->ea_index && !s->bt2_index) {
printf("Require to specify at least -s or -i or -f or -e or -r option\n");