From 31a8aa1ee84f4fba7597b0fa2e99f94596c079bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Scharfe?= Date: Sat, 15 Nov 2014 14:27:21 +0100 Subject: 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 --- builtin/receive-pack.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'builtin') 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) -- cgit v1.2.3