summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Young <dyoung@hdfgroup.org>2020-07-10 21:12:05 (GMT)
committerDavid Young <dyoung@hdfgroup.org>2020-07-10 21:12:05 (GMT)
commit09b17b6563f6ae3b5ed96369a93ee503b43b04cf (patch)
treefba60704c864bf070842611ef1d7a62ffc2d01ed
parent98f441a6067c8430c0b784dbf708599caa42196c (diff)
downloadhdf5-09b17b6563f6ae3b5ed96369a93ee503b43b04cf.zip
hdf5-09b17b6563f6ae3b5ed96369a93ee503b43b04cf.tar.gz
hdf5-09b17b6563f6ae3b5ed96369a93ee503b43b04cf.tar.bz2
Remove gratuitous local variable initialization: it's better to let the
compiler detect use-before-initialization. Use the safer `memset(p, ..., sizeof(*p))` idiom.
-rw-r--r--test/vfd_swmr.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/vfd_swmr.c b/test/vfd_swmr.c
index 3e574c6..2e66dc7 100644
--- a/test/vfd_swmr.c
+++ b/test/vfd_swmr.c
@@ -75,9 +75,9 @@ static hid_t
init_vfd_swmr_config_fapl(H5F_vfd_swmr_config_t *config, uint32_t tick_len, uint32_t max_lag,
hbool_t is_writer, uint32_t md_pages_reserved, const char *md_file_path, size_t pbuf_size)
{
- hid_t fapl = H5I_INVALID_HID;
+ hid_t fapl;
- HDmemset(config, 0, sizeof(H5F_vfd_swmr_config_t));
+ HDmemset(config, 0, sizeof(*config));
config->version = H5F__CURR_VFD_SWMR_CONFIG_VERSION;
config->tick_len = tick_len;