lkml.org 
[lkml]   [2015]   [Aug]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v2 net-next 1/2] lib: introduce strncpy_from_unsafe()
From
Date
On 8/28/15 2:48 PM, Steven Rostedt wrote:
>> * On success, returns the length of the string (not including the trailing
>> >+ * NUL).
> I think it includes the NUL.

oops. yes. that was a copy paste from strncpy_from_user comment.
trace_kprobe usage wants NUL to be counted, so I intended to have it
counted, but that brings the question what should be the semantics.
Should it be similar to strncpy_from_user (not counting NUL) or
similar to strlen_user (counts NUL) ?
imo counting NUL makes a little bit more sense, since when a user says
strncpy_from_unsafe(..., ..., 32)
and it returns 32 as the whole buffer was filled, it looks cleaner.
Thoughts?




\
 
 \ /
  Last update: 2015-08-29 00:21    [W:0.352 / U:0.728 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site