From 83915ba5219955e8c0b747ec413afe4f78bea289 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ren=C3=A9=20Scharfe?= Date: Sat, 15 Nov 2014 14:27:21 +0100 Subject: [PATCH] use labs() for variables of type long instead of abs() Using abs() on long values can cause truncation, so use labs() instead. Reported by Clang 3.5 (-Wabsolute-value, enabled by -Wall). Signed-off-by: Rene Scharfe Signed-off-by: Junio C Hamano --- config.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config.c b/config.c index 9e42d3832b..dd5e982788 100644 --- a/config.c +++ b/config.c @@ -490,9 +490,9 @@ static int git_parse_signed(const char *value, intmax_t *ret, intmax_t max) errno = EINVAL; return 0; } - uval = abs(val); + uval = labs(val); uval *= factor; - if (uval > max || abs(val) > uval) { + if (uval > max || labs(val) > uval) { errno = ERANGE; return 0; } -- 2.11.4.GIT