Re: [PATCH] tools: include: add proper strscpy() declaration
From: Maxwell Doose
Date: Mon May 04 2026 - 17:48:02 EST
On Mon, May 4, 2026 at 4:38 PM Maxwell Doose <m32285159@xxxxxxxxx> wrote:
>
> On Mon, May 4, 2026 at 4:23 PM Lucas Poupeau <lucasp.linux@xxxxxxxxx> wrote:
> >
> > Currently, strscpy() is defined as a macro for strcpy() in the tools
> > headers. This is unsafe and prevents using the real strscpy() logic
> > that provides better buffer overflow protection.
> >
> > Remove the macro hack and add a proper extern declaration for
> > strscpy(). This allows tools to use the safer string copying API
> > once the implementation is provided.
> >
> > Suggested-by: Maxwell Doose <m32285159@xxxxxxxxx>
> > Signed-off-by: Lucas Poupeau <lucasp.linux@xxxxxxxxx>
> >
> [snip]
> >
> > +extern ssize_t strscpy(char *dest, const char *src, size_t count);
> > +
> > +char *str_error_r(int errnum, char *buf, size_t buflen);
> > +
> > char *str_error_r(int errnum, char *buf, size_t buflen);
> >
>
> Looks like you have a duplicate definition here.
>
> best regards,
> max
>
Also would be worth checking sashiko's report:
https://sashiko.dev/#/patchset/20260504212301.63750-1-lucasp.linux%40gmail.com
best regards,
max