Re: [bugs] [PATCH] Fix integer parsing

On Tue, Nov 28, 2017 at 08:50:35PM +0100, Lukas Fleischer wrote:
> On Tue, 28 Nov 2017 at 20:32:26, Lars Henriksen wrote:
> >  static int config_parse_int(int *dest, const char *val)
> >  {
> > -       if ((*val == '+' || *val == '-' || isdigit(*val))
> > -           && is_all_digit(val + 1))
> 
> If the value is a single digit, isdigit(*val) is true and is_all_digit()
> is invoked with an empty string (which should also return true). So
> everything is as it should be...?

config_parse_int(&dest, "+")?

Links