diff options
author | René Scharfe <l.s.r@web.de> | 2014-11-15 16:27:21 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-11-17 19:54:34 +0300 |
commit | 83915ba5219955e8c0b747ec413afe4f78bea289 (patch) | |
tree | 49880c6d11be58b570af1e465dc0cc8945ca6f8f /config.c | |
parent | 7fa1365c54c28b3cd9375539f381b54061a1880d (diff) |
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 <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'config.c')
-rw-r--r-- | config.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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; } |