lkml.org 
[lkml]   [2014]   [Sep]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] staging: lustre: lustre: libcfs: debug.c: Cleaning up unnecessary use of memset in conjunction with strncpy
On Sun, Sep 14, 2014 at 06:03:16PM +0200, Rickard Strandqvist wrote:
> Using memset before strncpy just to ensure a trailing null
> character is an unnecessary double writing of a string
>

You really should make a function which pads and NUL terminates.

I've said this before, of course, but you haven't even tried.

I can't get excited about these cleanups which open code NUL termination
every where. They are risky and have introduced bugs before.

regards,
dan carpenter


\
 
 \ /
  Last update: 2014-09-15 11:01    [W:0.102 / U:0.200 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site