[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180604140652.34f28df7@gandalf.local.home>
Date: Mon, 4 Jun 2018 14:06:52 -0400
From: Steven Rostedt <rostedt@...dmis.org>
To: Nick Desaulniers <nick.desaulniers@...il.com>
Cc: mingo@...hat.com, linux-kernel@...r.kernel.org, trivial@...nel.org
Subject: Re: [PATCH] tracing: prefer strlcpy to strncpy
On Mon, 28 May 2018 23:03:38 -0700
Nick Desaulniers <nick.desaulniers@...il.com> wrote:
> Fixes a stringop-truncation warning from gcc-8.
>
> Signed-off-by: Nick Desaulniers <nick.desaulniers@...il.com>
Acked-by: Steven Rostedt (VMware) <rostedt@...dmis.org>
-- Steve
> ---
> 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);
> }
Powered by blists - more mailing lists