This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
RE: [PATCH][PING] Improve strncpy performance further
- From: "Wilco Dijkstra" <wdijkstr at arm dot com>
- To: <libc-alpha at sourceware dot org>
- Cc: "'Roland McGrath'" <roland at hack dot frob dot com>
- Date: Mon, 6 Jul 2015 12:28:32 +0100
- Subject: RE: [PATCH][PING] 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>
> 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