Re: [PATCH] nvme: prefer strlcpy to strncpy

From: Nick Desaulniers
Date: Tue May 29 2018 - 22:02:36 EST


On Tue, May 29, 2018 at 1:11 AM, Christoph Hellwig <hch@xxxxxx> wrote:
> On Mon, May 28, 2018 at 11:49:18PM -0700, Nick Desaulniers wrote:
>> Fixes a stringop-truncation warning from gcc-8.
>
> What would that warning be? Maybe it actually is genuinly useful,
> and switching to strlcpy just papers over it..

Eric also pointed out to me that strlcpy will not initialize the rest
of dest with zeros if size is less than the length of src.