summaryrefslogtreecommitdiff
path: root/test-genrandom.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2013-09-08 04:36:42 -0400
committerJunio C Hamano <gitster@pobox.com>2013-09-09 11:06:38 -0700
commit33fdd77e2b8ece3490982f9a35c8669d16879ba8 (patch)
tree4fdf8bc8a5dc3db299108feb14bf7aaf4c5b2071 /test-genrandom.c
parent42d194e95870a9eeea192789226b7d51b1c90c96 (diff)
downloadgit-33fdd77e2b8ece3490982f9a35c8669d16879ba8.tar.gz
config: set errno in numeric git_parse_* functions
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 to set ERANGE for range errors, and EINVAL for other errors, so that the caller can reliably tell these cases apart. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'test-genrandom.c')
0 files changed, 0 insertions, 0 deletions