Re: [PATCH 3/5] config: set errno in numeric git_parse_* functions
- From
Jeff King <peff@peff.net>
- Date
- Sep 9, 2013, 19:53 UTC
- Message-ID
- <20130909195304.GB14021@sigill.intra.peff.net>
- In-Reply-To
- <CAPig+cSPf0Cvk4Em71NX-ad46Ub7GysdhKUuqtjRU7fFTKOvSw@mail.gmail.com>
On Sun, Sep 08, 2013 at 08:36:35PM -0400, Eric Sunshine wrote:
Show 17 quoted lines
> On Sun, Sep 8, 2013 at 4:36 AM, Jeff King <peff@peff.net> wrote: > > When we are parsing an integer or unsigned long, we use > > the strto*max functions, which properly set errno to ERANGE > > if we get a large value. However, we also do further range > > checks after applying our multiplication factor, but do not > > set ERANGE. This means that a caller cannot tell if an error > > was caused by ERANGE or if the input was simply not a valid > > number. > > > > This patch teaches git_parse_signed and git_parse_unsigned > > reliably set ERANGE for range errors, and EINVAL for other > > Missing "to": s/reliably/to reliably/ > > Or, if you don't like splitting the infinitive: > > s/reliably set ERANGE/to set ERANGE reliably/
Thanks. That is what I get for last-minute tweaking of the commit message (and I am OK with splitting the infinitive :) ).
-Peff