summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSean McBride <sean@rogue-research.com>2021-02-19 15:18:30 (GMT)
committerGitHub <noreply@github.com>2021-02-19 15:18:30 (GMT)
commita6f1b6ce5398102c579821f5f6589b00e552d6d0 (patch)
tree22507eeb391dcba39f3eaeac28cd6032dfc1c49c
parent2ea165efd095d8876639814dc615dd01a2ec34e6 (diff)
downloadhdf5-a6f1b6ce5398102c579821f5f6589b00e552d6d0.zip
hdf5-a6f1b6ce5398102c579821f5f6589b00e552d6d0.tar.gz
hdf5-a6f1b6ce5398102c579821f5f6589b00e552d6d0.tar.bz2
Fixed various clang -Wformat-security warnings (#340)
-rw-r--r--src/H5Clog_json.c2
-rw-r--r--src/H5Clog_trace.c2
-rw-r--r--tools/src/h5import/h5import.c4
3 files changed, 4 insertions, 4 deletions
diff --git a/src/H5Clog_json.c b/src/H5Clog_json.c
index 6d048f1..731d741 100644
--- a/src/H5Clog_json.c
+++ b/src/H5Clog_json.c
@@ -173,7 +173,7 @@ H5C__json_write_log_message(H5C_log_json_udata_t *json_udata)
/* Write the log message and flush */
n_chars = HDstrlen(json_udata->message);
- if ((int)n_chars != HDfprintf(json_udata->outfile, json_udata->message))
+ if ((int)n_chars != HDfprintf(json_udata->outfile, "%s", json_udata->message))
HGOTO_ERROR(H5E_CACHE, H5E_LOGGING, FAIL, "error writing log message")
HDmemset((void *)(json_udata->message), 0, (size_t)(n_chars * sizeof(char)));
diff --git a/src/H5Clog_trace.c b/src/H5Clog_trace.c
index 8c79d7b..c30f79e 100644
--- a/src/H5Clog_trace.c
+++ b/src/H5Clog_trace.c
@@ -168,7 +168,7 @@ H5C__trace_write_log_message(H5C_log_trace_udata_t *trace_udata)
/* Write the log message and flush */
n_chars = HDstrlen(trace_udata->message);
- if ((int)n_chars != HDfprintf(trace_udata->outfile, trace_udata->message))
+ if ((int)n_chars != HDfprintf(trace_udata->outfile, "%s", trace_udata->message))
HGOTO_ERROR(H5E_CACHE, H5E_LOGGING, FAIL, "error writing log message")
HDmemset((void *)(trace_udata->message), 0, (size_t)(n_chars * sizeof(char)));
diff --git a/tools/src/h5import/h5import.c b/tools/src/h5import/h5import.c
index e3f4384..471af51 100644
--- a/tools/src/h5import/h5import.c
+++ b/tools/src/h5import/h5import.c
@@ -2536,7 +2536,7 @@ parsePathInfo(struct path_info *path, char *temp)
token = HDstrtok(temp, delimiter);
if (HDstrlen(token) >= MAX_PATH_NAME_LENGTH) {
- (void)HDfprintf(stderr, err1);
+ (void)HDfprintf(stderr, "%s", err1);
return (-1);
}
HDstrcpy(path->group[i++], token);
@@ -2546,7 +2546,7 @@ parsePathInfo(struct path_info *path, char *temp)
if (token == NULL)
break;
if (HDstrlen(token) >= MAX_PATH_NAME_LENGTH) {
- (void)HDfprintf(stderr, err1);
+ (void)HDfprintf(stderr, "%s", err1);
return (-1);
}
HDstrcpy(path->group[i++], token);