lkml.org 
[lkml]   [2020]   [Jun]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] crypto: hisilicon - fix strncpy warning with strlcpy
On Sun, Jun 07, 2020 at 01:03:45PM +0000, David Laight wrote:
> From: Herbert Xu
> > Sent: 05 June 2020 13:17
> ...
> > Better yet use strscpy which will even return an error for you.
>
> It really ought to return the buffer length on truncation.
> Then you can loop:
> while(...)
> buf += strxxxcpy(buf, src, buf_end - buf);
> and only check right at the end.
>
> David

scnprintf() can be used for that.

But that doesn't seem relevant to this patch.

- Eric

\
 
 \ /
  Last update: 2020-06-10 08:57    [W:0.145 / U:0.700 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site