diff options
author | Junio C Hamano <gitster@pobox.com> | 2019-07-09 15:25:41 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2019-07-09 15:25:41 -0700 |
commit | 7785f9ba030674671eb78ccfd2358f6903b632fb (patch) | |
tree | 53fbdf7f2d933eba81f87f3018a50d135c172f23 /config.c | |
parent | Merge branch 'dl/includeif-onbranch' (diff) | |
parent | config: avoid calling `labs()` on too-large data type (diff) | |
download | tgif-7785f9ba030674671eb78ccfd2358f6903b632fb.tar.xz |
Merge branch 'js/gcc-8-and-9'
Code clean-up for new compilers.
* js/gcc-8-and-9:
config: avoid calling `labs()` on too-large data type
winansi: simplify loading the GetCurrentConsoleFontEx() function
kwset: allow building with GCC 8
poll (mingw): allow compiling with GCC 8 and DEVELOPER=1
Diffstat (limited to 'config.c')
-rw-r--r-- | config.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -896,9 +896,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; } |