summaryrefslogtreecommitdiffstats
path: root/tools
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 /tools
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 'tools')
-rw-r--r--tools/src/misc/h5repart.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/tools/src/misc/h5repart.c b/tools/src/misc/h5repart.c
index feb447f..12b2932 100644
--- a/tools/src/misc/h5repart.c
+++ b/tools/src/misc/h5repart.c
@@ -227,6 +227,10 @@ main(int argc, char *argv[])
if (argno >= argc)
usage(prog_name);
src_gen_name = argv[argno++];
+ if (!src_gen_name) {
+ fprintf(stderr, "invalid source file name pointer");
+ exit(EXIT_FAILURE);
+ }
snprintf(src_name, NAMELEN, src_gen_name, src_membno);
src_is_family = strcmp(src_name, src_gen_name);
@@ -249,6 +253,10 @@ main(int argc, char *argv[])
if (argno >= argc)
usage(prog_name);
dst_gen_name = argv[argno++];
+ if (!dst_gen_name) {
+ fprintf(stderr, "invalid destination file name pointer");
+ exit(EXIT_FAILURE);
+ }
snprintf(dst_name, NAMELEN, dst_gen_name, dst_membno);
dst_is_family = strcmp(dst_name, dst_gen_name);