mirror of
https://github.com/HDFGroup/hdf5.git
synced 2025-03-13 16:47:58 +08:00
Merge pull request #1801 in HDFFV/hdf5 from ~DEROBINS/hdf5_der:develop_minor_pr to develop
* commit '3566fff6261d0bb8e360d3842e99919d2eb4ba73': Reverted snprintf to sprintf in the multi VFD since the former causes problems on Windows.
This commit is contained in:
commit
5314213f1e
@ -1966,30 +1966,30 @@ compute_next(H5FD_multi_t *file)
|
||||
static int
|
||||
open_members(H5FD_multi_t *file)
|
||||
{
|
||||
char tmp[H5FD_MULT_MAX_FILE_NAME_LEN];
|
||||
int nerrors=0;
|
||||
char tmp[H5FD_MULT_MAX_FILE_NAME_LEN];
|
||||
int nerrors = 0;
|
||||
static const char *func="(H5FD_multi)open_members"; /* Function Name for error reporting */
|
||||
|
||||
/* Clear the error stack */
|
||||
H5Eclear2(H5E_DEFAULT);
|
||||
|
||||
UNIQUE_MEMBERS(file->fa.memb_map, mt) {
|
||||
if(file->memb[mt])
|
||||
if(file->memb[mt])
|
||||
continue; /*already open*/
|
||||
assert(file->fa.memb_name[mt]);
|
||||
assert(file->fa.memb_name[mt]);
|
||||
/* Note: This truncates the user's filename down to only sizeof(tmp)
|
||||
* characters. -QK & JK, 2013/01/17
|
||||
*/
|
||||
snprintf(tmp, sizeof(tmp), file->fa.memb_name[mt], file->name);
|
||||
sprintf(tmp, file->fa.memb_name[mt], file->name);
|
||||
tmp[sizeof(tmp) - 1] = '\0';
|
||||
|
||||
H5E_BEGIN_TRY {
|
||||
file->memb[mt] = H5FDopen(tmp, file->flags, file->fa.memb_fapl[mt], HADDR_UNDEF);
|
||||
} H5E_END_TRY;
|
||||
if(!file->memb[mt]) {
|
||||
if(!file->fa.relax || (file->flags & H5F_ACC_RDWR))
|
||||
nerrors++;
|
||||
}
|
||||
H5E_BEGIN_TRY {
|
||||
file->memb[mt] = H5FDopen(tmp, file->flags, file->fa.memb_fapl[mt], HADDR_UNDEF);
|
||||
} H5E_END_TRY;
|
||||
if(!file->memb[mt]) {
|
||||
if(!file->fa.relax || (file->flags & H5F_ACC_RDWR))
|
||||
nerrors++;
|
||||
}
|
||||
} END_MEMBERS;
|
||||
if (nerrors)
|
||||
H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "error opening member files", -1)
|
||||
|
Loading…
x
Reference in New Issue
Block a user