Klemens Nanni wrote:
> > +           case 'z':
> > +                   autoaction = AUTO_SUSPEND;
> > +                   autolimit = strtonum(optarg, 1, 100, &errstr);
> > +                   if (errstr != NULL)
> > +                           error("invalid percent: %s", errstr);
> > +                   break;
> You should pass optarg instead of errstr to error(). Either ways error()
> will still append since it uses err(3). This leads to
> 
>       $ obj/apmd -dz0
>       apmd: invalid percent: too small: Result too large

actually, both, but you should use something like errc() instead of errno.

Reply via email to