diff options
author | Jeremy Huddleston <jeremyhu@apple.com> | 2015-10-14 15:13:36 -0700 |
---|---|---|
committer | Adam Jackson <ajax@redhat.com> | 2015-10-19 11:49:53 -0400 |
commit | 85eb90ea45e89033b97bf71a13c5c70fec8f6871 (patch) | |
tree | ef4d32f596a0c059dc25d43d220abd681a208eb2 | |
parent | 9f0fcd14b52f8481cbb3b3b9c6e06f64ff003cc8 (diff) |
xdmauth: Correct miscall of abs() to instrad call labs()
xdmauth.c:230:13: warning: absolute value function 'abs' given an argument of type 'long' but has parameter of
type
'int'
which may cause truncation of value [-Wabsolute-value,Semantic Issue]
if (abs(now - client->time) > TwentyFiveMinutes) {
^
xdmauth.c:230:13: note: use function 'labs' instead [Semantic Issue]
if (abs(now - client->time) > TwentyFiveMinutes) {
^~~
labs
xdmauth.c:302:9: warning: absolute value function 'abs' given an argument of type 'long' but has parameter of type
'int' which
may cause truncation of value [-Wabsolute-value,Semantic Issue]
if (abs(client->time - now) > TwentyMinutes) {
^
xdmauth.c:302:9: note: use function 'labs' instead [Semantic Issue]
if (abs(client->time - now) > TwentyMinutes) {
^~~
labs
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r-- | os/xdmauth.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/os/xdmauth.c b/os/xdmauth.c index f11cbb997..482bc67db 100644 --- a/os/xdmauth.c +++ b/os/xdmauth.c @@ -227,7 +227,7 @@ XdmClientAuthTimeout(long now) prev = 0; for (client = xdmClients; client; client = next) { next = client->next; - if (abs(now - client->time) > TwentyFiveMinutes) { + if (labs(now - client->time) > TwentyFiveMinutes) { if (prev) prev->next = next; else @@ -299,7 +299,7 @@ XdmAuthorizationValidate(unsigned char *plain, int length, } now += clockOffset; XdmClientAuthTimeout(now); - if (abs(client->time - now) > TwentyMinutes) { + if (labs(client->time - now) > TwentyMinutes) { free(client); if (reason) *reason = "Excessive XDM-AUTHORIZATION-1 time offset"; |