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: If glibc had a logo what would it be?


On Sat, Dec 08, 2012 at 09:13:58PM -0800, Andrew Pinski wrote:
> > I will be more than happy to submit patches adding strlcpy/strlcat, if
> > people will accept them, but it seems a giant waste of time, because
> > someone will surely say "we don't like this" or whatever.  Well, guess
> > what?  Nobody likes the alternatives proposed by the GLIBC maintainers
> > every time this is discussed, so perhaps the functions should be added
> > now instead of coming up with crappy reasons to avoid doing so.
> 
> Post a patch then :).

Giving how much trouble it is to get a patch in acceptable form, I
think it makes sense to first gauge whether there's still opposition
to adding them.

> Also see the FAQ which describe why they are
> not a good idea and an even better alternative:
> http://sourceware.org/glibc/wiki/FAQ#Why_no_strlcpy_.2BAC8_strlcat.3F

If glibc were in the business of rejecting every nonstandard but
widely available function that has better alternatives, it would
probably be half the size it is now. :-)

I'm among the first to criticize C code that's using the string
concatenation idiom rather than snprintf, but I also realize that my
own dislike for bad idioms isn't going to stop others from using them,
and that we're all better-off (in terms of security) if programmers
who insist on using bad idioms at least have slightly better tools at
their disposal.

Rich


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