This is the mail archive of the libc-alpha@sources.redhat.com 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: [open-source] Re: Wish for 2002 ...


On Fri, Jan 11, 2002 at 10:30:51AM -0800, Linus Torvalds wrote:
> > > 	len = strlen(challenge) + strlen(PROMPT) + 1;
> > > 	p = xmalloc(len);
> > > 	p[0] = '\0';
> > > 	strlcat(p, challenge, len);
> > > 	strlcat(p, PROMPT, len);
> > >
> > > Here, the use of strlcat is redundant: strcat would do just as well,
> > > and would be clearer, smaller, and no doubt faster.
> > >
> > > I expect your other examples are similar.
> >
> > The code will not be converted to use strcat().
> 
> Nobody sane would convert it to strcat. The above code is CRAP.
> 
> Who the h*ll is the idiot that does "concatenate the empty string with
> that string that I just took the length of", and then argues about strcat
> vs strlcat?

hey, get off your high horse, it's obvious that this should read 'cpy'
and not 'cat'.  your flame neither makes the strncpy/strncat interface
more consistent nor easier to use than strlcpy/strlcat.


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