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>
This commit is contained in:
René Scharfe 2014-11-15 14:27:21 +01:00 коммит произвёл Junio C Hamano
Родитель 6f5ef44e0d
Коммит 31a8aa1ee8
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -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)