summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Huddleston <jeremyhu@apple.com>2015-10-14 15:13:36 -0700
committerAdam Jackson <ajax@redhat.com>2015-10-26 12:20:29 -0400
commita88460ca82c7aed00177a5bb733b98a7f9b45968 (patch)
tree7dbf3122574e1fdae6e0d5aa9182162ac33cac7a
parent0f051cb4c3af6c3b906c2f210e3b6858dd7a5f53 (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> (cherry picked from commit 85eb90ea45e89033b97bf71a13c5c70fec8f6871)
-rw-r--r--os/xdmauth.c4
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";