On Fri, Jul 29, 2016 at 03:02:57PM +0200, Gabriel Laskar wrote:
> On Wed, Jul 27, 2016 at 08:41:16PM +0200, Nahim El Atmani wrote:
[...]
> > + negative = 0;
> > + if (*ss == '-') {
> > + negative = 1;
> > + ++ss;
> > + }
> > +
> > + if (*ss >= '0' && *ss <= '9') {
>
> We should be able to pass a negative number as an error value, no?
> This also justify the usage of string_to_int instead of string_to_uint.
>
> > + if (-1 == (opts.err = string_to_int(ss)))
> > + goto bad_format;
> > + }
> > + else {
> > + opts.err = find_errno_by_name(ss);
> > + if (opts.err < 0)
> > + goto bad_format;
> > + }
> > + if (negative)
> > + opts.err *= -1;The code already handles negative numbers, although in a strange manner. -- ldv
pgpvEJWDomjNt.pgp
Description: PGP signature
------------------------------------------------------------------------------
_______________________________________________ Strace-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/strace-devel
