summaryrefslogtreecommitdiff
path: root/config.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2019-07-09 22:25:41 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-07-09 22:25:41 (GMT)
commit7785f9ba030674671eb78ccfd2358f6903b632fb (patch)
tree53fbdf7f2d933eba81f87f3018a50d135c172f23 /config.c
parent3707986b7b9921751aee0e8339914a8c24d81ed0 (diff)
parent9dae4fe79f85dd0eaf41215bea76c68b65398fbc (diff)
downloadgit-7785f9ba030674671eb78ccfd2358f6903b632fb.zip
git-7785f9ba030674671eb78ccfd2358f6903b632fb.tar.gz
git-7785f9ba030674671eb78ccfd2358f6903b632fb.tar.bz2
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.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/config.c b/config.c
index ad4166e..972d3c1 100644
--- a/config.c
+++ b/config.c
@@ -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;
}