From: Eric Sunshine Date: Mon, 09 Sep 2013 00:36:35 GMT Subject: Re: [PATCH 3/5] config: set errno in numeric git_parse_* functions Message-ID: In-Reply-To: <20130908083642.GC29554@sigill.intra.peff.net> On Sun, Sep 8, 2013 at 4:36 AM, Jeff King 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/ > errors. > > Signed-off-by: Jeff King