diff options
Diffstat (limited to 'src/H5Fint.c')
-rw-r--r-- | src/H5Fint.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/H5Fint.c b/src/H5Fint.c index 1aa289d..9cdb9a0 100644 --- a/src/H5Fint.c +++ b/src/H5Fint.c @@ -1300,7 +1300,8 @@ H5F__new(H5F_shared_t *shared, unsigned flags, hid_t fcpl_id, hid_t fapl_id, H5F if (NULL == (f->shared->mdc_log_location = (char *)H5MM_calloc((len + 1) * sizeof(char)))) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, NULL, "can't allocate memory for mdc log file name"); - strncpy(f->shared->mdc_log_location, mdc_log_location, len); + strncpy(f->shared->mdc_log_location, mdc_log_location, len + 1); + f->shared->mdc_log_location[len] = '\0'; } else f->shared->mdc_log_location = NULL; |