On Wed, Sep 27, 2023 at 11:05 PM Justin Stitt wrote:
>
> On Wed, Sep 27, 2023 at 9:49 PM Guenter Roeck wrote:
> >
> > On Thu, Sep 21, 2023 at 05:41:46AM +, Justin Stitt wrote:
> > > `strncpy` is deprecated for use on NUL-terminated destination strings [1].
> > >
> > > Let's refactor this kcal
On Wed, Sep 27, 2023 at 9:49 PM Guenter Roeck wrote:
>
> On Thu, Sep 21, 2023 at 05:41:46AM +, Justin Stitt wrote:
> > `strncpy` is deprecated for use on NUL-terminated destination strings [1].
> >
> > Let's refactor this kcalloc() + strncpy() into a kmemdup_nul() which has
> > more obvious be
On Thu, Sep 21, 2023 at 05:41:46AM +, Justin Stitt wrote:
> `strncpy` is deprecated for use on NUL-terminated destination strings [1].
>
> Let's refactor this kcalloc() + strncpy() into a kmemdup_nul() which has
> more obvious behavior and is less error prone.
>
> To avoid truncating the last
On Thu, Sep 21, 2023 at 05:41:46AM +, Justin Stitt wrote:
> `strncpy` is deprecated for use on NUL-terminated destination strings [1].
>
> Let's refactor this kcalloc() + strncpy() into a kmemdup_nul() which has
> more obvious behavior and is less error prone.
>
> To avoid truncating the last
`strncpy` is deprecated for use on NUL-terminated destination strings [1].
Let's refactor this kcalloc() + strncpy() into a kmemdup_nul() which has
more obvious behavior and is less error prone.
To avoid truncating the last byte supply `...length + 1` to
kmemdup_nul() as `element->string.length`