summaryrefslogtreecommitdiffstats
path: root/src/H5FDlog.c
diff options
context:
space:
mode:
authorjhendersonHDF <jhenderson@hdfgroup.org>2023-11-01 13:16:33 (GMT)
committerGitHub <noreply@github.com>2023-11-01 13:16:33 (GMT)
commit562c53c44a22c979419deb1cb025b2a74900fbac (patch)
treec50148d3341883aff1aaa536e839c5d233bb43f6 /src/H5FDlog.c
parenta654b2c1c5670010e14d8fba6d287ce62c87169a (diff)
downloadhdf5-562c53c44a22c979419deb1cb025b2a74900fbac.zip
hdf5-562c53c44a22c979419deb1cb025b2a74900fbac.tar.gz
hdf5-562c53c44a22c979419deb1cb025b2a74900fbac.tar.bz2
Fix misc. warnings from GCC when compiling with -fsanitize=undefined (#3787)
Diffstat (limited to 'src/H5FDlog.c')
-rw-r--r--src/H5FDlog.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/H5FDlog.c b/src/H5FDlog.c
index 8d43dc8..e35a6a6 100644
--- a/src/H5FDlog.c
+++ b/src/H5FDlog.c
@@ -545,7 +545,7 @@ H5FD__log_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr)
#endif /* H5_HAVE_WIN32_API */
/* Retain a copy of the name used to open the file, for possible error reporting */
- strncpy(file->filename, name, sizeof(file->filename));
+ strncpy(file->filename, name, sizeof(file->filename) - 1);
file->filename[sizeof(file->filename) - 1] = '\0';
/* Get the flags for logging */