Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 16 Feb 2023 08:15:01 +0100
From:      Emmanuel Vadot <manu@bidouilliste.com>
To:        Jessica Clarke <jrtc27@freebsd.org>
Cc:        =?ISO-8859-1?Q?Jean-S=E9bastien_P=E9dron?= <dumbbell@FreeBSD.org>, "src-committers@freebsd.org" <src-committers@FreeBSD.org>, "dev-commits-src-all@freebsd.org" <dev-commits-src-all@FreeBSD.org>, "dev-commits-src-main@freebsd.org" <dev-commits-src-main@FreeBSD.org>
Subject:   Re: git: b1a9e570fe2d - main - linuxkpi: Add `strscpy_pad()` to <linux/string.h>
Message-ID:  <20230216081501.506e86584558eeb315a9314f@bidouilliste.com>
In-Reply-To: <BC964557-C184-435B-ABE5-C26AED29EED0@freebsd.org>
References:  <202302152226.31FMQQV8093715@gitrepo.freebsd.org> <BC964557-C184-435B-ABE5-C26AED29EED0@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 15 Feb 2023 22:27:31 +0000
Jessica Clarke <jrtc27@freebsd.org> wrote:

> On 15 Feb 2023, at 22:26, Jean-S=E9bastien P=E9dron <dumbbell@FreeBSD.org=
> wrote:
> >=20
> > The branch main has been updated by dumbbell (ports committer):
> >=20
> > URL: https://cgit.FreeBSD.org/src/commit/?id=3Db1a9e570fe2da0a43c41327d=
7ce21b27bf8257b8
> >=20
> > commit b1a9e570fe2da0a43c41327d7ce21b27bf8257b8
> > Author:     Jean-S=E9bastien P=E9dron <dumbbell@FreeBSD.org>
> > AuthorDate: 2023-02-14 23:46:13 +0000
> > Commit:     Jean-S=E9bastien P=E9dron <dumbbell@FreeBSD.org>
> > CommitDate: 2023-02-15 22:19:41 +0000
> >=20
> >    linuxkpi: Add `strscpy_pad()` to <linux/string.h>
> >=20
> >    It's the same as `strscpy()` except that it fills the rest of the
> >    destination buffer with zeroes if the source buffer is shorter.
> >=20
> >    Reviewed by:    manu
> >    Approved by:    manu
> > ---
> > sys/compat/linuxkpi/common/include/linux/string.h | 9 +++++++++
> > 1 file changed, 9 insertions(+)
> >=20
> > diff --git a/sys/compat/linuxkpi/common/include/linux/string.h b/sys/co=
mpat/linuxkpi/common/include/linux/string.h
> > index 65422cac629c..20c3729aaf12 100644
> > --- a/sys/compat/linuxkpi/common/include/linux/string.h
> > +++ b/sys/compat/linuxkpi/common/include/linux/string.h
> > @@ -207,6 +207,15 @@ strscpy(char* dst, const char* src, size_t len)
> > 	return (-E2BIG);
> > }
> >=20
> > +static inline ssize_t
> > +strscpy_pad(char* dst, const char* src, size_t len)
> > +{
> > +
>=20
> style(9) doesn?t need this blank line any more, please stop including
> them in your commits.
>=20
> Jess

 style(9) says that it's optional and we have them in a lot of files
(including in some of the functions in this file). If you really hate
them you should see how to update style(9) to say that we should
never include a blank line. Making something optional is perfect to
ensure that you will have both ways of doing thing in the code.

> > +	bzero(dst, len);
> > +
> > +	return (strscpy(dst, src, len));
> > +}
> > +
> > static inline void *
> > memset32(uint32_t *b, uint32_t c, size_t len)
> > {
>=20


--=20
Emmanuel Vadot <manu@bidouilliste.com> <manu@freebsd.org>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20230216081501.506e86584558eeb315a9314f>