diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/H5srcdir.h | 11 | ||||
-rw-r--r-- | test/h5test.c | 20 |
2 files changed, 8 insertions, 23 deletions
diff --git a/test/H5srcdir.h b/test/H5srcdir.h index 8bc8780..202d050 100644 --- a/test/H5srcdir.h +++ b/test/H5srcdir.h @@ -50,10 +50,12 @@ static const char *H5_get_srcdir_filename(const char *filename) #ifdef H5_VMS if(filename[0] == '[') { char *tmp = filename; - srcdir_testpath[strlen(srcdir)-1] = '\0'; - strcat(srcdir_testpath, ++tmp); - } else - strcat(srcdir_testpath, filename); + + srcdir_testpath[HDstrlen(srcdir) - 1] = '\0'; + HDstrcat(srcdir_testpath, ++tmp); + } /* end if */ + else + HDstrcat(srcdir_testpath, filename); #else HDstrcat(srcdir_testpath, "/"); HDstrcat(srcdir_testpath, filename); @@ -84,4 +86,3 @@ static const char *H5_get_srcdir(void) } #endif /* _H5SRCDIR_H */ - diff --git a/test/h5test.c b/test/h5test.c index 91497e3..32d78bd 100644 --- a/test/h5test.c +++ b/test/h5test.c @@ -1124,24 +1124,8 @@ h5_make_local_copy(const char *origfilename, const char *local_copy_name) { int fd_old = (-1), fd_new = (-1); /* File descriptors for copying data */ ssize_t nread; /* Number of bytes read in */ - char buf[READ_BUF_SIZE]; /* Buffer for copying data */ - char filename[FILENAME_BUF_SIZE] = ""; -#ifdef H5_VMS - HDstrcat(filename, origfilename); -#else - const char * srcdir = HDgetenv("srcdir"); /* The source directory */ - - /* Check for using the srcdir from configure time */ - if(NULL == srcdir) - srcdir = config_srcdir; - - if(srcdir && ((HDstrlen(srcdir) + - HDstrlen(origfilename) + 6) < FILENAME_BUF_SIZE)) { - HDstrcpy(filename, srcdir); - HDstrcat(filename, "/"); - } - HDstrcat(filename, origfilename); -#endif + char buf[READ_BUF_SIZE]; /* Buffer for copying data */ + const char *filename = H5_get_srcdir_filename(origfilename);; /* Get the test file name to copy */ /* Copy old file into temporary file */ if((fd_old = HDopen(filename, O_RDONLY, 0666)) < 0) return -1; |