From: Andi Kleen <ak@linux.intel.com>
To: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>,
Paul Mackerras <paulus@samba.org>, Ingo Molnar <mingo@redhat.com>,
Arnaldo Carvalho de Melo <acme@kernel.org>,
Jiri Olsa <jolsa@redhat.com>, Namhyung Kim <namhyung.kim@lge.com>,
Adrian Hunter <adrian.hunter@intel.com>,
Stephane Eranian <eranian@google.com>,
David Ahern <dsahern@gmail.com>,
Vince Weaver <vincent.weaver@maine.edu>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] tools: perf: util: parse-events.c: Cleaning up missing null-terminate after strncpy call
Date: Wed, 4 Jun 2014 15:31:14 -0700 [thread overview]
Message-ID: <20140604223114.GC16855@tassilo.jf.intel.com> (raw)
In-Reply-To: <CAFo99gY_GZg7TY=H_UZBDL3dP2vL6NW-TCvtCDx+voY0uH80AA@mail.gmail.com>
On Thu, Jun 05, 2014 at 12:23:55AM +0200, Rickard Strandqvist wrote:
> Hi
>
> A little embarrassing, but I actually did not know that there was a
> better replacement for strncpy.
This works for perf, but not in general because standard glibc
does not have strlcpy. snprintf works always.
In practice if you could tolerate strncpy always zeroing
the complete string before you can also tolerate snprintf.
-Andi
next prev parent reply other threads:[~2014-06-04 22:31 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-04 21:46 [PATCH] tools: perf: util: parse-events.c: Cleaning up missing null-terminate after strncpy call Rickard Strandqvist
2014-06-04 22:20 ` Andi Kleen
2014-06-04 22:23 ` Rickard Strandqvist
2014-06-04 22:31 ` Andi Kleen [this message]
2014-06-06 13:16 ` Rickard Strandqvist
2014-06-06 13:22 ` Jiri Olsa
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=20140604223114.GC16855@tassilo.jf.intel.com \
--to=ak@linux.intel.com \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=dsahern@gmail.com \
--cc=eranian@google.com \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=namhyung.kim@lge.com \
--cc=paulus@samba.org \
--cc=rickard_strandqvist@spectrumdigital.se \
--cc=vincent.weaver@maine.edu \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.