diff options
author | René Scharfe <l.s.r@web.de> | 2014-11-15 14:27:21 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-11-17 08:57:07 -0800 |
commit | 31a8aa1ee84f4fba7597b0fa2e99f94596c079bb (patch) | |
tree | 392314094cd252de73c2e3e47b0a8ee8c3449442 /builtin/receive-pack.c | |
parent | 6f5ef44e0d8933621fcd50127518557013002313 (diff) | |
download | git-31a8aa1ee84f4fba7597b0fa2e99f94596c079bb.tar.gz git-31a8aa1ee84f4fba7597b0fa2e99f94596c079bb.tar.xz |
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 42f25a510..a38ea7ddb 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) |