From: Nick Desaulniers <nick.desaulniers@gmail.com>
To: rostedt@goodmis.org, mingo@redhat.com
Cc: Nick Desaulniers <nick.desaulniers@gmail.com>,
linux-kernel@vger.kernel.org
Subject: [PATCH] tracing: prefer strlcpy to strncpy
Date: Mon, 28 May 2018 23:03:38 -0700 [thread overview]
Message-ID: <1527573818-29712-1-git-send-email-nick.desaulniers@gmail.com> (raw)
Fixes a stringop-truncation warning from gcc-8.
Signed-off-by: Nick Desaulniers <nick.desaulniers@gmail.com>
---
kernel/trace/trace_events_hist.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_hist.c
index b9061ed..b53a6c0 100644
--- a/kernel/trace/trace_events_hist.c
+++ b/kernel/trace/trace_events_hist.c
@@ -393,7 +393,7 @@ static void hist_err_event(char *str, char *system, char *event, char *var)
else if (system)
snprintf(err, MAX_FILTER_STR_VAL, "%s.%s", system, event);
else
- strncpy(err, var, MAX_FILTER_STR_VAL);
+ strlcpy(err, var, MAX_FILTER_STR_VAL);
hist_err(str, err);
}
--
2.7.4
next reply other threads:[~2018-05-29 6:03 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-29 6:03 Nick Desaulniers [this message]
2018-05-30 1:55 ` [PATCH] tracing: prefer strlcpy to strncpy Nick Desaulniers
2018-06-04 18:10 ` Steven Rostedt
2018-06-04 18:06 ` Steven Rostedt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1527573818-29712-1-git-send-email-nick.desaulniers@gmail.com \
--to=nick.desaulniers@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=rostedt@goodmis.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).