lkml.org 
[lkml]   [2014]   [Jun]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] tools: perf: util: parse-events.c: Cleaning up missing null-terminate after strncpy call
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


\
 
 \ /
  Last update: 2014-06-05 01:01    [W:2.348 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site