This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Improve strncpy performance further
- From: OndÅej BÃlka <neleai at seznam dot cz>
- To: Wilco Dijkstra <wdijkstr at arm dot com>
- Cc: 'Roland McGrath' <roland at hack dot frob dot com>, libc-alpha at sourceware dot org
- Date: Wed, 13 May 2015 21:02:28 +0200
- Subject: Re: [PATCH] Improve strncpy performance further
- Authentication-results: sourceware.org; auth=none
- References: <001801d02b72$6ce0c3c0$46a24b40$ at com> <20150108185812 dot 285782C3BF6 at topped-with-meat dot com> <000501d07778$5cac4900$1604db00$ at com>
On Wed, Apr 15, 2015 at 01:33:22PM +0100, Wilco Dijkstra wrote:
> ping
>
> > Wilco Dijkstra wrote:
> > > > Roland McGrath:
> > > > Has to be __strnlen.
> > >
> > > Good point, so it becomes:
> > >
> > > - return s;
> > > + size_t size = __strnlen (s2, n);
> > > + if (size != n)
> > > + memset (s1 + size, '\0', n - size);
> > > + return memcpy (s1, s2, size);
> >
> > OK for trunk with __strnlen?
> >
> > Wilco
Ok for me.