summaryrefslogtreecommitdiff
path: root/builtin/receive-pack.c
diff options
context:
space:
mode:
authorRené Scharfe <l.s.r@web.de>2014-11-15 13:27:21 (GMT)
committerJunio C Hamano <gitster@pobox.com>2014-11-17 16:57:07 (GMT)
commit31a8aa1ee84f4fba7597b0fa2e99f94596c079bb (patch)
tree392314094cd252de73c2e3e47b0a8ee8c3449442 /builtin/receive-pack.c
parent6f5ef44e0d8933621fcd50127518557013002313 (diff)
downloadgit-31a8aa1ee84f4fba7597b0fa2e99f94596c079bb.zip
git-31a8aa1ee84f4fba7597b0fa2e99f94596c079bb.tar.gz
git-31a8aa1ee84f4fba7597b0fa2e99f94596c079bb.tar.bz2
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.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/receive-pack.c b/builtin/receive-pack.c
index 42f25a5..a38ea7d 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)