diff options
author | jhendersonHDF <jhenderson@hdfgroup.org> | 2023-11-01 13:16:33 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-01 13:16:33 (GMT) |
commit | 562c53c44a22c979419deb1cb025b2a74900fbac (patch) | |
tree | c50148d3341883aff1aaa536e839c5d233bb43f6 /tools | |
parent | a654b2c1c5670010e14d8fba6d287ce62c87169a (diff) | |
download | hdf5-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.c | 8 |
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); |