This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Improve strncpy performance further


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]