]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
RADIUS DAS: Avoid compiler warning on abs()
authorJouni Malinen <j@w1.fi>
Tue, 7 Jul 2015 09:14:47 +0000 (12:14 +0300)
committerJouni Malinen <j@w1.fi>
Tue, 7 Jul 2015 13:25:06 +0000 (16:25 +0300)
The input parameter ended up being converted to long int instead of int,
so use an explicit typecase to get rid of the compiler warning.

Signed-off-by: Jouni Malinen <j@w1.fi>
src/radius/radius_das.c

index 39ceea879cafeeffd2059c51dbaac5f9f9c63975..b7d991bbd097956ccb78bb1987297bf0104c22eb 100644 (file)
@@ -245,7 +245,7 @@ static void radius_das_receive(int sock, void *eloop_ctx, void *sock_ctx)
                                  (u8 *) &val, 4);
        if (res == 4) {
                u32 timestamp = ntohl(val);
-               if ((unsigned int) abs(now.sec - timestamp) >
+               if ((unsigned int) abs((int) (now.sec - timestamp)) >
                    das->time_window) {
                        wpa_printf(MSG_DEBUG, "DAS: Unacceptable "
                                   "Event-Timestamp (%u; local time %u) in "