summaryrefslogtreecommitdiffstats
path: root/utils/tools
diff options
context:
space:
mode:
Diffstat (limited to 'utils/tools')
-rw-r--r--utils/tools/h5dwalk/h5dwalk.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/utils/tools/h5dwalk/h5dwalk.c b/utils/tools/h5dwalk/h5dwalk.c
index d7e22ba..5a22d75 100644
--- a/utils/tools/h5dwalk/h5dwalk.c
+++ b/utils/tools/h5dwalk/h5dwalk.c
@@ -1071,12 +1071,12 @@ run_command(int argc __attribute__((unused)), char **argv, char *cmdline, const
if ((log_instance > 0) || processing_inputfile) {
if (processing_inputfile)
log_instance = current_input_index;
- HDsprintf(logpath, "%s/%s_%s.log_%d", HDgetcwd(current_dir, sizeof(current_dir)), logbase,
- thisapp, log_instance);
+ HDsnprintf(logpath, sizeof(logpath), "%s/%s_%s.log_%d",
+ HDgetcwd(current_dir, sizeof(current_dir)), logbase, thisapp, log_instance);
}
else {
- HDsprintf(logpath, "%s/%s_%s.log", HDgetcwd(current_dir, sizeof(current_dir)), logbase,
- thisapp);
+ HDsnprintf(logpath, sizeof(logpath), "%s/%s_%s.log",
+ HDgetcwd(current_dir, sizeof(current_dir)), logbase, thisapp);
}
}
else {
@@ -1085,15 +1085,17 @@ run_command(int argc __attribute__((unused)), char **argv, char *cmdline, const
if (processing_inputfile)
log_instance = current_input_index;
if (txtlog[log_len - 1] == '/')
- HDsprintf(logpath, "%s%s_%s.log_%d", txtlog, logbase, thisapp, log_instance);
+ HDsnprintf(logpath, sizeof(logpath), "%s%s_%s.log_%d", txtlog, logbase, thisapp,
+ log_instance);
else
- HDsprintf(logpath, "%s/%s_%s.log_%d", txtlog, logbase, thisapp, log_instance);
+ HDsnprintf(logpath, sizeof(logpath), "%s/%s_%s.log_%d", txtlog, logbase, thisapp,
+ log_instance);
}
else {
if (txtlog[log_len - 1] == '/')
- HDsprintf(logpath, "%s%s_%s.log", txtlog, logbase, thisapp);
+ HDsnprintf(logpath, sizeof(logpath), "%s%s_%s.log", txtlog, logbase, thisapp);
else
- HDsprintf(logpath, "%s/%s_%s.log", txtlog, logbase, thisapp);
+ HDsnprintf(logpath, sizeof(logpath), "%s/%s_%s.log", txtlog, logbase, thisapp);
}
}
@@ -1204,7 +1206,7 @@ MFU_PRED_EXEC(mfu_flist flist, uint64_t idx, void *arg)
}
}
- HDsprintf(cmdline, "\n---------\nCommand:");
+ HDsnprintf(cmdline, sizeof(cmdline), "\n---------\nCommand:");
b_offset = strlen(cmdline);
for (k = 0; k < count; k++) {
HDsprintf(&cmdline[b_offset], " %s", argv[k]);
@@ -1242,7 +1244,7 @@ static void
add_executable(int argc, char **argv, char *cmdstring, int *f_index, int f_count __attribute__((unused)))
{
char cmdline[2048];
- HDsprintf(cmdline, "\n---------\nCommand: %s\n", cmdstring);
+ HDsnprintf(cmdline, sizeof(cmdline), "\n---------\nCommand: %s\n", cmdstring);
argv[argc] = NULL;
run_command(argc, argv, cmdline, argv[f_index[0]]);
return;