This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Re: [open-source] Re: Wish for 2002 ...
- From: Markus Friedl <markus at openbsd dot org>
- To: Linus Torvalds <torvalds at transmeta dot com>
- Cc: Paul Eggert <eggert at twinsun dot com>, leclerc at austin dot sns dot slb dot com, security-audit at ferret dot lmh dot ox dot ac dot uk, libc-alpha at sources dot redhat dot com, openssh at openbsd dot org
- Date: Fri, 11 Jan 2002 21:20:42 +0100
- Subject: Re: [open-source] Re: Wish for 2002 ...
- References: <20020111112251.GA2186@faui02> <Pine.LNX.4.33.0201111019010.3952-100000@penguin.transmeta.com>
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.