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, 11 Jan 2002, Linus Torvalds wrote:

>
> On Fri, 11 Jan 2002, Markus Friedl wrote:
>
> > On Thu, Jan 10, 2002 at 04:37:27PM -0800, Paul Eggert wrote:
> > > 	len = strlen(challenge) + strlen(PROMPT) + 1;
> > > 	p = xmalloc(len);
> > > 	p[0] = '\0';
> > > 	strlcat(p, challenge, len);
	^^ This really should be strlcpy() and the p[0] line should be
deleted  it makes really no sense to concat to an blank string.

No where else do we do this unless we are in a loop where we can not use
strlcpy() to create a base string (or that I see off hand).

p[0]='\0'
while (..) {
	if (..)
		strlcat(..)
}

- Ben


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