[PATCH] support for find -user

Denis Vlasenko vda.linux at googlemail.com
Fri Feb 2 13:19:11 PST 2007


On Friday 02 February 2007 08:09, Natanael Copa wrote:
> On Thu, 2007-02-01 at 23:36 +0100, Denis Vlasenko wrote:
> > On Wednesday 31 January 2007 21:55, Natanael Copa wrote:
> > > The attatched patch adds support for option -user. The arg to -user can
> > > be either username or uid.
> > >
> > > Would be nice if it could be committed.
> > > Thanks!
> > 
> > +                       ap->uid = bb_strtoul(arg1, (char **)NULL, 10);
> > 
> > Why you use *strtoul* and then assign it to unsigned *int*?
> 
> You are right. The uid type should ofcourse be uid_t and not int.

Ideally, yes.

> The xuname2uid() returns a long (why not uid_t?) so i think I could use
> strtol() instead of bb_strtou().

strtol treats really bizarre things like "      -" as 'numbers'.
That's why we have bb_strtoXXX.
--
vda


More information about the busybox mailing list