summaryrefslogtreecommitdiff
path: root/config.c
diff options
context:
space:
mode:
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 296a6d9cc4..01c6e9df23 100644
--- a/config.c
+++ b/config.c
@@ -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;
}