diff --git a/builtin/receive-pack.c b/builtin/receive-pack.c
index 42f25a5103a..a38ea7ddb39 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)