aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Wendling <morbo@google.com>2020-11-09 14:13:35 -0800
committerBen Hutchings <ben@decadent.org.uk>2020-12-12 22:46:25 +0100
commit11f41a418ad02e50b7f5a8768981c5a28cd9482d (patch)
tree81530e6d33c8689ce0ed1e3e72412eefc6378c27
parent815b8ef2a741108c5f7a81c83beef3645b82beec (diff)
downloadklibc-11f41a418ad02e50b7f5a8768981c5a28cd9482d.tar.gz
[klibc] dash: shell: Fix clang warnings about format string
Build with clang results in some warnings about using a non-string literal for a format string. ----------------------------------------------------------------------- usr/dash/jobs.c:429:23: warning: format string is not a string literal (potentially insecure) [-Wformat-security] col = fmtstr(s, 32, strsignal(st)); ^~~~~~~~~~~~~ usr/dash/jobs.c:429:23: note: treat the string as an argument to avoid this col = fmtstr(s, 32, strsignal(st)); ^ "%s", ----------------------------------------------------------------------- Signed-off-by: Bill Wendling <morbo@google.com> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
-rw-r--r--usr/dash/jobs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/usr/dash/jobs.c b/usr/dash/jobs.c
index b9ff1402038451..f027cc10db6021 100644
--- a/usr/dash/jobs.c
+++ b/usr/dash/jobs.c
@@ -426,7 +426,7 @@ sprint_status(char *s, int status, int sigonly)
goto out;
#endif
}
- col = fmtstr(s, 32, strsignal(st));
+ col = fmtstr(s, 32, "%s", strsignal(st));
#ifdef WCOREDUMP
if (WCOREDUMP(status)) {
col += fmtstr(s + col, 16, " (core dumped)");