lkml.org 
[lkml]   [2015]   [May]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/3] string: provide strscpy() and strscpy_truncate()
We actually do have a __must_check tag so it's easy enough to force
people to check. A different option is we could make it trigger a
WARN_ONCE().

#define strXcpy(dest, src, len) (({ \
ssize_t __ret = strscpy_truncate(dest, src, len); \
WARN_ONCE(__ret < 0, "strXcpy trancates\n"); \
__ret; }))

I have never really cared about truncation, though. I think not caring
is the common case.

regards,
dan carpenter



\
 
 \ /
  Last update: 2015-05-06 18:41    [W:0.188 / U:0.132 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site