Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Some more setenv(3) update



On Wed, Oct 13, 2010 at 07:40:19PM +0100, David Laight wrote:
> On Wed, Oct 13, 2010 at 12:04:03AM +0200, Joerg Sonnenberger wrote:
> > On Mon, Oct 11, 2010 at 11:01:30PM +0000, Christos Zoulas wrote:
> > > You could move the loop:
> > > 
> > >        for (cc = name; *cc && *cc != '='; ++cc)        /* no `=' in name 
> > > */
> > >                continue;
> > 
> > You could also use the more concise strcspn.
> 
> strcspn() might be more concise, but it is a much slower function
> than strchr()....

No, it isn't. It actually has the above loop as special case for
strlen(charset) == 1.

Joerg


Home | Main Index | Thread Index | Old Index