Merge pull request #2258 from dscho/gcc-9-gfw

Support compiling with GCC v9.x
This commit is contained in:
Johannes Schindelin
2019-07-11 14:08:15 +02:00
committed by GitHub

View File

@@ -869,9 +869,9 @@ static int git_parse_signed(const char *value, intmax_t *ret, intmax_t max)
errno = EINVAL;
return 0;
}
uval = labs(val);
uval = val < 0 ? -val : val;
uval *= factor;
if (uval > max || labs(val) > uval) {
if (uval > max || (val < 0 ? -val : val) > uval) {
errno = ERANGE;
return 0;
}