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:57:07 +0300 |
commit | 31a8aa1ee84f4fba7597b0fa2e99f94596c079bb (patch) | |
tree | 392314094cd252de73c2e3e47b0a8ee8c3449442 /builtin/receive-pack.c | |
parent | 6f5ef44e0d8933621fcd50127518557013002313 (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 'builtin/receive-pack.c')
-rw-r--r-- | builtin/receive-pack.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/receive-pack.c b/builtin/receive-pack.c index 42f25a5103..a38ea7ddb3 100644 --- a/builtin/receive-pack.c +++ b/builtin/receive-pack.c @@ -429,7 +429,7 @@ static const char *check_nonce(const char *buf, size_t len) nonce_stamp_slop = (long)ostamp - (long)stamp; if (nonce_stamp_slop_limit && - abs(nonce_stamp_slop) <= nonce_stamp_slop_limit) { + labs(nonce_stamp_slop) <= nonce_stamp_slop_limit) { /* * Pretend as if the received nonce (which passes the * HMAC check, so it is not a forged by third-party) |