diff options
Diffstat (limited to 'tools/src')
-rw-r--r-- | tools/src/h5perf/sio_engine.c | 6 | ||||
-rw-r--r-- | tools/src/h5repack/h5repack_copy.c | 6 | ||||
-rw-r--r-- | tools/src/misc/h5repart.c | 8 |
3 files changed, 10 insertions, 10 deletions
diff --git a/tools/src/h5perf/sio_engine.c b/tools/src/h5perf/sio_engine.c index c12e1da..e113e82 100644 --- a/tools/src/h5perf/sio_engine.c +++ b/tools/src/h5perf/sio_engine.c @@ -522,7 +522,7 @@ do_write(results *res, file_descr *fd, parameters *parms, void *buffer) } /* end if */ } /* end if */ - HDsprintf(dname, "Dataset_%ld", (unsigned long)parms->num_bytes); + HDsnprintf(dname, sizeof(dname), "Dataset_%ld", (unsigned long)parms->num_bytes); h5ds_id = H5Dcreate2(fd->h5fd, dname, ELMT_H5_TYPE, h5dset_space_id, H5P_DEFAULT, h5dcpl, H5P_DEFAULT); @@ -851,7 +851,7 @@ do_read(results *res, file_descr *fd, parameters *parms, void *buffer) break; case HDF5: - HDsprintf(dname, "Dataset_%ld", (long)parms->num_bytes); + HDsnprintf(dname, sizeof(dname), "Dataset_%ld", (long)parms->num_bytes); h5ds_id = H5Dopen2(fd->h5fd, dname, H5P_DEFAULT); if (h5ds_id < 0) { HDfprintf(stderr, "HDF5 Dataset open failed\n"); @@ -1181,7 +1181,7 @@ set_vfd(parameters *param) return -1; for (mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; mt++) { memb_fapl[mt] = H5P_DEFAULT; - HDsprintf(sv->arr[mt], "%%s-%c.h5", multi_letters[mt]); + HDsnprintf(sv->arr[mt], 1024, "%%s-%c.h5", multi_letters[mt]); memb_name[mt] = sv->arr[mt]; memb_addr[mt] = (haddr_t)MAX(mt - 1, 0) * (HADDR_MAX / 10); } diff --git a/tools/src/h5repack/h5repack_copy.c b/tools/src/h5repack/h5repack_copy.c index c38a431..25df5c7 100644 --- a/tools/src/h5repack/h5repack_copy.c +++ b/tools/src/h5repack/h5repack_copy.c @@ -1531,7 +1531,7 @@ print_dataset_info(hid_t dcpl_id, char *objname, double ratio, int pr, pack_opt_ { unsigned level = cd_values[0]; - HDsprintf(temp, "(%d)", level); + HDsnprintf(temp, sizeof(temp), "(%d)", level); HDstrcat(strfilter, temp); } #endif @@ -1545,7 +1545,7 @@ print_dataset_info(hid_t dcpl_id, char *objname, double ratio, int pr, pack_opt_ unsigned options_mask = cd_values[0]; /* from dcpl, not filt*/ unsigned ppb = cd_values[1]; - HDsprintf(temp, "(%d,", ppb); + HDsnprintf(temp, sizeof(temp), "(%d,", ppb); HDstrcat(strfilter, temp); if (options_mask & H5_SZIP_EC_OPTION_MASK) HDstrcpy(temp, "EC) "); @@ -1588,7 +1588,7 @@ print_dataset_info(hid_t dcpl_id, char *objname, double ratio, int pr, pack_opt_ HDstrcpy(str, "dset "); HDstrcat(str, strfilter); - HDsprintf(temp, " (%.3f:1)", ratio); + HDsnprintf(temp, sizeof(temp), " (%.3f:1)", ratio); HDstrcat(str, temp); if (options->verbose == 2) HDprintf(FORMAT_OBJ_TIME, str, read_time, write_time, objname); diff --git a/tools/src/misc/h5repart.c b/tools/src/misc/h5repart.c index f4cef6a..078883d 100644 --- a/tools/src/misc/h5repart.c +++ b/tools/src/misc/h5repart.c @@ -242,7 +242,7 @@ main(int argc, char *argv[]) if (argno >= argc) usage(prog_name); src_gen_name = argv[argno++]; - HDsprintf(src_name, src_gen_name, src_membno); + HDsnprintf(src_name, NAMELEN, src_gen_name, src_membno); src_is_family = strcmp(src_name, src_gen_name); if ((src = HDopen(src_name, O_RDONLY)) < 0) { @@ -264,7 +264,7 @@ main(int argc, char *argv[]) if (argno >= argc) usage(prog_name); dst_gen_name = argv[argno++]; - HDsprintf(dst_name, dst_gen_name, dst_membno); + HDsnprintf(dst_name, NAMELEN, dst_gen_name, dst_membno); dst_is_family = HDstrcmp(dst_name, dst_gen_name); if ((dst = HDopen(dst_name, O_RDWR | O_CREAT | O_TRUNC, H5_POSIX_CREATE_MODE_RW)) < 0) { @@ -356,7 +356,7 @@ main(int argc, char *argv[]) dst_offset = dst_offset + (off_t)n; break; } - HDsprintf(src_name, src_gen_name, ++src_membno); + HDsnprintf(src_name, NAMELEN, src_gen_name, ++src_membno); if ((src = HDopen(src_name, O_RDONLY)) < 0 && ENOENT == errno) { dst_offset = dst_offset + (off_t)n; break; @@ -404,7 +404,7 @@ main(int argc, char *argv[]) } } HDclose(dst); - HDsprintf(dst_name, dst_gen_name, ++dst_membno); + HDsnprintf(dst_name, NAMELEN, dst_gen_name, ++dst_membno); if ((dst = HDopen(dst_name, O_RDWR | O_CREAT | O_TRUNC, H5_POSIX_CREATE_MODE_RW)) < 0) { HDperror(dst_name); HDexit(EXIT_FAILURE); |