Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
use labs() for variables of type long instead of abs()
author
René Scharfe
<l.s.r@web.de>
Sat, 15 Nov 2014 13:27:21 +0000
(14:27 +0100)
committer
Junio C Hamano
<gitster@pobox.com>
Mon, 17 Nov 2014 16:57:07 +0000
(08:57 -0800)
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>
builtin/receive-pack.c
patch
|
blob
|
history
raw
|
patch
| inline |
side by side
(parent:
6f5ef44
)
diff --git
a/builtin/receive-pack.c
b/builtin/receive-pack.c
index 42f25a5103a72486c46d7b3a584f249495dc12b4..a38ea7ddb396d0ae2a3f76b2c84223d88bf50ffb 100644
(file)
--- 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) {
+
l
abs(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)